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

Function doBootstrap

test/angular/1.3/angular.js:1430–1465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1428 };
1429 config = extend(defaultConfig, config);
1430 var doBootstrap = function() {
1431 element = jqLite(element);
1432
1433 if (element.injector()) {
1434 var tag = (element[0] === document) ? 'document' : startingTag(element);
1435 //Encode angle brackets to prevent input from being sanitized to empty string #8683
1436 throw ngMinErr(
1437 'btstrpd',
1438 "App Already Bootstrapped with this Element '{0}'",
1439 tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1440 }
1441
1442 modules = modules || [];
1443 modules.unshift(['$provide', function($provide) {
1444 $provide.value('$rootElement', element);
1445 }]);
1446
1447 if (config.debugInfoEnabled) {
1448 // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
1449 modules.push(['$compileProvider', function($compileProvider) {
1450 $compileProvider.debugInfoEnabled(true);
1451 }]);
1452 }
1453
1454 modules.unshift('ng');
1455 var injector = createInjector(modules, config.strictDi);
1456 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
1457 function bootstrapApply(scope, element, compile, injector) {
1458 scope.$apply(function() {
1459 element.data('$injector', injector);
1460 compile(element)(scope);
1461 });
1462 }]
1463 );
1464 return injector;
1465 };
1466
1467 var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
1468 var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;

Callers 1

bootstrapFunction · 0.70

Calls 3

startingTagFunction · 0.70
createInjectorFunction · 0.70
compileFunction · 0.70

Tested by

no test coverage detected