0

i am quite new in angular and still learning. so just found today angular.bootstrap function it run ng code manually.

i do not understand what kind of angular js code we need to run manually by angular.bootstrap function and which code does not require angular.bootstrap function to run manually.

so just tell me what to look for in code to identify that code can run or we need to use angular.bootstrap function to run the code. please discuss with example. thanks

Thomas
  • 33,544
  • 126
  • 357
  • 626
  • best angular training stuff url http://stackoverflow.com/questions/14333857/how-to-master-angularjs – Thomas Mar 10 '16 at 12:08

1 Answers1

0

angular.bootstrap is created to manually bootstrap the application in opposite to automatic bootstrap when you have

<element ng-app="myAppName">
//code
</element>

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

If you need to have more control over the initialization process, you can use a manual bootstrapping method instead. Examples of when you'd need to do this include using script loaders or the need to perform an operation before Angular compiles a page.

Bottom line if you have a module to bootstrap use ng-app="moduleName" and all your code will work

if you want to run several applications on the page (which is not tested by Angular and might cause problems with complex apps) then you have to use manual boootstrap

maurycy
  • 8,455
  • 1
  • 27
  • 44
  • give me two small sample code which clearly explain when we need to manually bootstrap. the code u give here not clear. i need to identify and know which code need manual boostrap ? – Thomas Mar 08 '16 at 12:21