1) What is AngularJS?
2) What are the key features of AngularJS?
The key features of AngularJS are:
- Data Binding
3) Explain services in AngularJS
AngularJS services are the singleton objects or functions that are used for carrying out specific tasks. It holds some business logic.
4) Explain function scope in AngularJS
Scope refers to the application model. It acts like a glue between the application controller and the view. Scopes are arranged in a hierarchical structure and impersonate the DOM (Document Object Model) structure of the application. It can watch expressions and propagate events.
5) What are directives? Name some of the most commonly used directives in AngularJS application
A directive is something that introduces new syntax. They are like markers on the DOM element, which attaches a special behavior to it. In any AngularJS application, directives are the most important components.
Some of the commonly used directives are:
6) What is data binding in AngularJS?
Automatic synchronization of data between the model and view components is referred to as data binding in AngularJS. There are two ways for data binding
- Data mining in classical template systems
- Data binding in angular templates
7) Explain directives and their types
During compilation process, when a specific HTML function is triggered, it is referred to as directive. It is executed when the compiler encounters it in the DOM.
Different types of directives are:
1) Element directives
2) Attribute directives
3) CSS class directives
4) Comment directives.
8) Explain injector in AngularJS
An injector is a service locator. It is used to retrieve object instances as defined by the provider, instantiate types, invoke methods, and load modules. There is a single injector per Angular application, it helps to look up an object instance by its name.
9) What is the main difference between a link and compile in Angular.js?
- Compile function: It is used for template DOM manipulation and collects all of the directives.
- Link function: It is used for registering DOM listeners as well as for instance, DOM manipulation. It is executed once the template has been cloned.
10) What is the factory function in AngularJS?
For creating the directive, factory method is used. It is invoked only once when the compiler matches the directive for the first time. By using $injector.invoke the factory method is invoked.
11) What is ng-non-bindable in AngularJS?
Ng-non-bindable specifies AngularJs to not compile the HTML element and its child nodes. For example:
<title ng-non-bindable > </title>