1)What is bootstraping in angular JS ?
Bootstrapping in angular JS means, The process of angular code getting initialized/loaded.
This process can be in 2 ways where angular provided to us one is auto bootstrap and another is mannual bootstrap.
1.Auto Bootstrap : Auto bootstrapping can be done by simply providing the ng-app directive in any of the HTML element and here that element becomes as root element of angular.
Ex: <div ng-app="angapp"> </div>
2.Mannual Bootstrap : Mannual bootstrapping means, the developer itself makes a decission when to
initialize the angular by using javascript code & thing to remember is that we should create the concern module.
Ex: angular.bootstrap(document, ['angapp']);
2)Differences between $scope and $rootscope ?
$rootscope related variables will be in angular application level,means can be accessed in all controllers under concern angular application.
$scope related variables can be accessed to the one where it has been initailized itself. Means, it related to the particular contoller itself.We cant access one controllers $scope variable in another controller.
Have to remember that $rootscope is the parent to $scope.
3)What is expression in angular JS ?
In angular JS expressions are used to hold and display the data of application. Means here, the applications data can be in any format.
{{ 'data' }}
{{ firstname }} // firstname as model binds the result of that variable.
{{ arr[0] }} // binds the array with index 0 value
{{ emp.sal }} //binds the sal from the object emp
4)How do we perform one-time binding and what it is?
One-Time binding is nothing but making our expression model value to bind once.
After binding even any modifications done over that model, It wont show the modified one. The watcher will stop watching over that model.
To make any model as one time binding use " :: " before the model inside expression.
{{ ::modelname }}
More about bindings : Data Bindings in Angular JS
5)Differences between ng-model and ng-bind directive ?
As both directives difference comes from bindings if you are new, follow my article on data bindings in angular JS.
ng-bind tends to achieve the one-way data binding. We can only view the data and cant do any modifications to make reflect in model. In general we try to display/show content via span, p, b,...e.t.c tags, we are not allowed to use ng-bind in HTML input tags.
ng-model tends to achieve the two-way data binding.Not only for the view purpose ng-model also achieves the modification done over it can reflect in model too as because of two-way data binding.
6)Differences between constant and value ?
Constant : Constant variable values cannot be changed. These variables can be injected in anywhere(contollers, services, providers, config section...e.t.c) in the applciation.
value : value variable values can be changed.These variables cannot be injected in config section.
For more ,
Constant : Constant in angular JS
Value : Value in angular JS
7)Explain about buit-in filter 'filter' ?
"filter" the term is also a one of the built-in filter by which we can filter the data based on the given expression.
In general the filters should be associated with the pipe(|) symbol.
<td ng-repeat="x in Employees | filter : 'S'">{{x}}</td> // Filters with the letter 's'.
Custom filters :Custom Filters in angular JS
Built-in filters : Built-In filters in angular JS
8)What are providers ?
Providers are the one which provide services in the application level.
Providers can gat configured in the config function.
The provider function can return object or primitives or can be as function.
while configuring the providers, we cant access any angular services.
To know more : Providers in angular JS
9)How do you bind a dropdownlist ?
Droplist can be bind by using the ng-options, We can even bind by usng the ng-repeat. But we prefer ng-options as returns in object level data.
If we bind with ng-options, we'll get the default 0th index as the blank which indicates as not selected any item.
Dropdownlist data binding : Dropdownlist in angular JS
10)Differences between ng-options and ng-repeat ?
Both the things are used to repetative or loop over the collection.
In ng-repeat usage, its not mandatory to include ng-model. Whereas the ng-options should be used by including the ng-model.
To know more : Differences between ng-repeat and ng-options
Bootstrapping in angular JS means, The process of angular code getting initialized/loaded.
This process can be in 2 ways where angular provided to us one is auto bootstrap and another is mannual bootstrap.
1.Auto Bootstrap : Auto bootstrapping can be done by simply providing the ng-app directive in any of the HTML element and here that element becomes as root element of angular.
Ex: <div ng-app="angapp"> </div>
2.Mannual Bootstrap : Mannual bootstrapping means, the developer itself makes a decission when to
initialize the angular by using javascript code & thing to remember is that we should create the concern module.
Ex: angular.bootstrap(document, ['angapp']);
2)Differences between $scope and $rootscope ?
$rootscope related variables will be in angular application level,means can be accessed in all controllers under concern angular application.
$scope related variables can be accessed to the one where it has been initailized itself. Means, it related to the particular contoller itself.We cant access one controllers $scope variable in another controller.
Have to remember that $rootscope is the parent to $scope.
3)What is expression in angular JS ?
In angular JS expressions are used to hold and display the data of application. Means here, the applications data can be in any format.
{{ 'data' }}
{{ firstname }} // firstname as model binds the result of that variable.
{{ arr[0] }} // binds the array with index 0 value
{{ emp.sal }} //binds the sal from the object emp
4)How do we perform one-time binding and what it is?
One-Time binding is nothing but making our expression model value to bind once.
After binding even any modifications done over that model, It wont show the modified one. The watcher will stop watching over that model.
To make any model as one time binding use " :: " before the model inside expression.
{{ ::modelname }}
More about bindings : Data Bindings in Angular JS
5)Differences between ng-model and ng-bind directive ?
As both directives difference comes from bindings if you are new, follow my article on data bindings in angular JS.
ng-bind tends to achieve the one-way data binding. We can only view the data and cant do any modifications to make reflect in model. In general we try to display/show content via span, p, b,...e.t.c tags, we are not allowed to use ng-bind in HTML input tags.
ng-model tends to achieve the two-way data binding.Not only for the view purpose ng-model also achieves the modification done over it can reflect in model too as because of two-way data binding.
6)Differences between constant and value ?
Constant : Constant variable values cannot be changed. These variables can be injected in anywhere(contollers, services, providers, config section...e.t.c) in the applciation.
value : value variable values can be changed.These variables cannot be injected in config section.
For more ,
Constant : Constant in angular JS
Value : Value in angular JS
7)Explain about buit-in filter 'filter' ?
"filter" the term is also a one of the built-in filter by which we can filter the data based on the given expression.
In general the filters should be associated with the pipe(|) symbol.
<td ng-repeat="x in Employees | filter : 'S'">{{x}}</td> // Filters with the letter 's'.
Custom filters :Custom Filters in angular JS
Built-in filters : Built-In filters in angular JS
8)What are providers ?
Providers are the one which provide services in the application level.
Providers can gat configured in the config function.
The provider function can return object or primitives or can be as function.
while configuring the providers, we cant access any angular services.
To know more : Providers in angular JS
9)How do you bind a dropdownlist ?
Droplist can be bind by using the ng-options, We can even bind by usng the ng-repeat. But we prefer ng-options as returns in object level data.
If we bind with ng-options, we'll get the default 0th index as the blank which indicates as not selected any item.
Dropdownlist data binding : Dropdownlist in angular JS
10)Differences between ng-options and ng-repeat ?
Both the things are used to repetative or loop over the collection.
In ng-repeat usage, its not mandatory to include ng-model. Whereas the ng-options should be used by including the ng-model.
To know more : Differences between ng-repeat and ng-options
No comments:
Post a Comment