Wednesday 9 March 2016

Angularjs Interview Questions

1. What is angular js?
Ans:  Angularjs is javascript framework, used for create  a single page application.

2. Why angularjs?
Ans: HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.

3. What are the general features of angularjs
Ans:
  • AngularJS is a JavaScript framework.
  • AngularJS is a efficient framework that can create Rich Internet Applications.
  • Client side  MVC frameWork. 
  • Applications written in AngularJS are cross-browser compliant.
  • SPA (Single Page Application)
  • Supported for Web and mobiles.
  • AngularJS is open source, completely free.
  • AngularJS is a framework to build large scale Apps.
  • High performance, and easyto-maintain web applications.

4. What are the core Features Angularjs ?
Ans: 

  • Two way Data-binding: It is the automatic synchronization of data between model   and view 
  • Scope : scope is an object that refers to the application model. Every controller has an associated scope object. Scopes provide APIs ($watch) to observe model mutations.
  • Controller: These are JavaScript functions bound to a particular scope.
  • Services: AngularJS comes with several built-in services such as $http to make a XMLHttpRequests. These are singleton objects which are instantiated only once in app.
  • Filters: These select a subset of items from an array and returns a new array.
  • Directives: 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 such as ngBind, ngModel, ngApp, ngShow,ngHide, ngInit   etc.. 
  • Routing: It is concept of switching views.
  • Templates: These are the rendered view with information from the controller and model. These can be a single file (such as index.html) or multiple views in one page using partials.
  • MVC: Model View whatever ex: MVVM (Model-View-ViewModel)

5. Explain what is data binding in AngularJS ?

Automatic synchronization of data between the model and view components is referred as data binding in AngularJS.  There are two ways for data binding
two way binding {{varName}} or ng-bind="varName"
once binding {{::varName}} or ng-bind="::varName"