Sunday, 8 November 2015

usage of Run method in the Angular JS

In this post we are going to see what is the usage of Run method in the Angular Js. Normally this method is used to Register any component or assign any variable before the Bootstrap of a application. i.e it is run at before the Application bootstraps.




In the above example you may notice that the Variable Project is assigned in the $rootScope. Then the Variable is rendered in the h1 tag. we can able to get the value of project after the bootstrap, but value is initialized before the application bootstrap


Output:
**********


From this post you may understand what is the usage of Run method in the Angular Js.

No comments:

Post a Comment