AngularJS Interview QuestionsDownload AngularJS Interview Questions PDF
AngularJS Interview Questions
AngularJS digest cycle is the process behind Angular JS data binding.
In each digest cycle, Angular compares the old and the new version of the scope model values. The digest cycle is triggered automatically. We can also use $apply() if we want to trigger the digest cycle manually.
We can share data by creating a service, Services are easiest, fastest and cleaner way to share data between controllers in AngularJs.
There are also other ways to share data between controllers, they are
- Using Events
- $parent, nextSibling, controllerAs
- Using the $rootScope
AngularJS directives are extended HTML attributes with the prefix ng-
The 3 main directives of angular js are
- ng-app:- directive is used to flag the HTML element that Angular should consider to be the root element of our application. Angular uses spinal-case for its custom attributes and camelCase for the corresponding directives which implement them.
- ng-model:- directive allows us to bind values of HTML controls (input, select, textarea) to application data. When using ngModel, not only change in the scope reflected in the view, but changes in the view are reflected back into the scope.
- ng-bind:- directive binds application modal data to the HTML view.
The controller is a function which generally takes an empty scope object as a parameter and adds to it the fields and functions that will be later exposed to the user via the view.
The scope is the object that represents the “model” of your application. It contains fields that store data which is presented to the user via the template, as well as functions which can be called when the user performs certain actions such as clicking a button.
The template is the HTML portion of the angular app. It is exactly like a static HTML page, except that templates contain additional syntax which allows data to be injected in it in order to provide a customized user experience.
- Create an angular.module
- Assign a controller to the module
- Link your module to HTML with ng-app
- Link the controller to HTML with ng-controller directive
Subscribe Our NewsLetter
Never Miss an Articles from us.
- Common Interview Questions
- Python Flask Interview Questions
- NoSQL interview questions
- JQuery Interview Questions
- C programming interview questions
- AngularJS Interview Questions
- Node JS Interview Questions with Express
- Core Java interview questions
- HTML Interview Questions
- Laravel interview questions
- Wordpress Interview Questions
- Core PHP Interview Questions