Safe ads

Sunday, 19 March 2017

AngularJS Interview Questions Part - 1

AngularJS Interview Questions Part - 1




Q 1.     What is AngularJS?
Ans 1. AngularJS is a powerful Javascript framework. It is used to create Single Page Application projects. It extends HTML DOM with additional attributes and makes it more responsive to user actions. It is licenced under the Apache license version 2.0. AngularJS is open source and completely free.

Q 2.     What are the advantages of using AngularJS?
Ans 2. Following are the advantages of using AngularJS –

·       Application written in AngularJS is cross-browser compliant and it automatically handles JavaScript code suitable for each browser.
·       AngularJS is a framework to build large scale and high performance web application while keeping them as easy-to-maintain.
·       Angular's data binding and dependency injection eliminate much of the code you currently have to write

Q 3.    What is the latest version of AngularJS framework?
Ans 3. The latest version of AngularJS framework is 1.6.3

Q 4.     What architectural pattern is followed by AngularJS?
Ans 4. AngularJS follows MVW architectural pattern i.e. Model View Whatever. It can act as MVC, MVVM and MVP. For several years AngularJS was closer to MVC, but over time and thanks to many refactoring and api improvements, it is now closer to MVVM – the $scope object could be considered the ViewModel that is being decorated by a function that we call a Controller. It is up to us to use AngularJS through any pattern that best suits our requirements.

Q 5.     What are the various features of AngularJS?
Ans 5. Following are the various Core features of AngularJS –

·       Data-binding 
·       Scope
·       Controller 
·       Services
·       Filters
·       Directives
·       Templates
·       Routing
·       Deep Linking
·       Dependency Injection

Q 6.     How to setup AngularJS environment?
Ans 6. You can setup the environment for AngularJS through various options-
1. You can download the AngularJS library directly from - https://angularjs.org/
2. You can use the AngularJS library directly from a google CDN
3. You can get it from GitHub.
Include the AngularJS framework in your code as follows –
<head>
   <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>


Q 7.     What are the disadvantages of AngularJS?
Ans 7. Though AngularJS has many advantages which make it an obvious choice for web development, but it still has some disadvantages -
·        Not Secure − Being JavaScript only framework, application written in AngularJS are not safe. Server side authentication and authorization is must to keep an application secure.
·        Not degradable − If your application user disables JavaScript then user will just see the basic page and nothing more.
Q 8.     What is data binding in AngularJS?
Ans 8. It is the automatic synchronization of data between model and view components. It is achieved through ng-model directive.

Q 9.     What is Scope in AngularJS?
Ans 9. It is an object that refers to the model. It acts as a glue between controller and view.

Q 10.     What is Controller in AngularJS?
Ans 10. Controller is a JavaScript function that is bound to a particular scope.

Click here to watch more informative AngularJS Tutorial videos!

Q 11.     What is Controller in AngularJS?
Ans 11. Controller is a JavaScript function that is bound to a particular scope.

Q 12.     What are services in AngularJS?
Ans 12. AngularJS comes with several built-in services for example $https: to make a XMLHttpRequests. These are singleton objects which are instantiated only once in app and can be used by different components.

Q 13.     What are filters in AngularJS?
Ans 13. These select a subset of items from an array and return a new array. These also format the data to be displayed.

Q 14.     What are directives in AngularJS?
Ans 14. Directives are markers on DOM elements (such as elements, attributes, css, and more). These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives (ng-bind, ng-model and many more).

Q 15.     What are templates in AngularJS?
Ans 15. These are the rendered views with information from the controller and model. These can be a single file (like index.html) or multiple views in one page using "partials".

Q 16.     What is routing in AngularJS?
Ans 16. It is the concept of switching views.

Q 17.     What is deep linking in AngularJS?
Ans 17. Deep linking allows you to encode the state of application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.

Q 18.     What is dependency injection in AngularJS?
Ans 18. AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test.

Q 19.     Explain AngularJS boot process?
Ans 19. When the page is loaded in the browser, following things happen:

·        HTML document is loaded into the browser, and evaluated by the browser. AngularJS JavaScript file is loaded; the angular global object is created. Next, JavaScript which registers controller functions is executed.
·        Next AngularJS scans through the HTML to look for AngularJS apps and views. Once view is located, it connects that view to the corresponding controller function.
·        Next, AngularJS executes the controller functions. It then renders the views with data from the model populated by the controller. The page gets ready.



7 comments:

  1. hi Tech Geek,

    Thanks for your Great information,

    please add more Angular (in-depth) interview questions and JavaScript and OOPs questions

    ReplyDelete
    Replies
    1. Thank you Mahesh for your valuable feedback!!

      I will definitely create more informative blogs soon.

      Regards

      Delete
  2. I Visited lot of blogs and Web sites But in this AngularJS Blog Information is Very usefulthanks for sharing it........

    ReplyDelete
    Replies
    1. Thank you Kamalakar for you valuable feedback!!

      Regards

      Delete