| Question: |
Explain what is compile in Angular.js? |
| Answer: |
Compile: It is used for template DOM Manipulation and collect all of the directives. |
| Question: |
What is controller in AngularJS? |
| Answer: |
Controller is constructor function in Angular Controller.
When a Controller is attached to the DOM with use the ng-controller, Angular will instantiate a new Controller object using constructor function. |
| Question: |
What is the purpose of the directive 'ng-open'? |
| Answer: |
ng-open: Specifies the open attribute of an element. |
| Question: |
What is the purpose of the directive 'ng-otions'? |
| Answer: |
ng-otions: Specifies
<options> in a <select>
list. |
| Question: |
What are Directives in AngularJS? |
| Answer: |
Directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS’s HTML compiler ($compile) to attach a specified behavior to that DOM element (e.g. via event listeners), or even to transform the DOM element and its children. Angular comes with a set of these directives built-in, like ngBind, ngModel, and ngClass. Much like you create controllers and services, you can create your own directives for Angular to use. When Angular bootstraps your application, the HTML compiler traverses the DOM matching directives against the DOM elements. |
| Question: |
What is $rootscope in AngularJS? |
| Answer: |
Every application has a single root scope. All other scopes are descendant scopes of the root scope. Scopes provide separation between the model and the view, via a mechanism for watching the model for changes. They also provide event emission/broadcast and subscription facility. |
| Question: |
What is the purpose of the directive 'ng-srcset'? |
| Answer: |
ng-srcset: Specifies the srcset attribute for the
<img>
element. |
| Question: |
What is the purpose of the directive 'ng-style'? |
| Answer: |
ng-style: Specifies the style attribute for an element. |
| Question: |
What are templates in AngularJS?
|
| Answer: |
In Angular, templates are written with HTML that contains Angular-specific elements and attributes. Angular combines the template with information from the model and controller to render the dynamic view that a user sees in the browser. In other words, if your HTML page is having some Angular specific elements/attributes it becomes a template in AngularJS. |
| Question: |
What is the purpose of the directive 'ng-checked'? |
| Answer: |
ng-checked: Specifies if an element is checked or not. |