Improve this Doc View Source angular.bootstrap

  1. function in module ng

Use this function to manually start up angular application.

See: Bootstrap

Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually. They must use ngApp.

Angular will detect if it has been loaded into the browser more than once and only allow the first loaded script to be bootstrapped and will report a warning to the browser console for each of the subsequent scripts. This prevents strange results in applications, where otherwise multiple instances of Angular try to work on the DOM.

Usage

angular.bootstrap(element, [modules]);

Arguments

Param Type Details
element DOMElement

DOM element which is the root of angular application.

modules
(optional)
Array<String|Function|Array>=

an array of modules to load into the application. Each item in the array should be the name of a predefined module or a (DI annotated) function that will be invoked by the injector as a run block. See: modules

Returns

auto.$injector

Returns the newly created injector for this app.

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.2.32/docs/api/ng/function/angular.bootstrap