MCPcopy
hub / github.com/angular-ui/ui-router / doBootstrap

Function doBootstrap

test/angular/1.2/angular.js:1429–1456  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1427 */
1428function bootstrap(element, modules) {
1429 var doBootstrap = function() {
1430 element = jqLite(element);
1431
1432 if (element.injector()) {
1433 var tag = (element[0] === document) ? 'document' : startingTag(element);
1434 //Encode angle brackets to prevent input from being sanitized to empty string #8683
1435 throw ngMinErr(
1436 'btstrpd',
1437 "App Already Bootstrapped with this Element '{0}'",
1438 tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1439 }
1440
1441 modules = modules || [];
1442 modules.unshift(['$provide', function($provide) {
1443 $provide.value('$rootElement', element);
1444 }]);
1445 modules.unshift('ng');
1446 var injector = createInjector(modules);
1447 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', '$animate',
1448 function(scope, element, compile, injector, animate) {
1449 scope.$apply(function() {
1450 element.data('$injector', injector);
1451 compile(element)(scope);
1452 });
1453 }]
1454 );
1455 return injector;
1456 };
1457
1458 var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
1459

Callers 1

bootstrapFunction · 0.70

Calls 3

startingTagFunction · 0.70
createInjectorFunction · 0.70
compileFunction · 0.70

Tested by

no test coverage detected