Friday, April 10, 2015

Anguler js boot strap event

https://docs.angularjs.org/guide/bootstrap 


 AngularJS bootstrapping. There are two options for bootstrapping:
automatic bootstrap and manual bootstrap. Let’s explore both of
these options:
Automati c Bootst rap
Three main things happen when AngularJS is automatically
bootstrapping. First, AngularJS creates an injector object, which
will be used later on for dependency injection. Then, AngularJS
creates the root scope, which is the root for all the scopes in the
application. Finally, AngularJS compiles the Document Object
Model (DOM) starting from the ng-app directive, compiling
and processing all the directives and bindings that it finds in the

DOM.

<!doctype html>
<html ng-app=”myApp”>
<head>
<script src=”https://ajax.googleapis.com/ajax/libs/
angularjs/1.2.9/angular.min.js”></script>
</head>
<body>
<div>
</div>
</body>

</html>

Manual Bootst rap
Sometimes you want to perform operations before AngularJS
starts. These operations can be configurations, retrieving relevant
data or anything else you might think about. AngularJS enables
you to manual bootstrap the application. You will need to remove
the ng-app directive from the HTML and use the angular.

bootstrap function instead.

No comments: