MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / doBootstrap

Function doBootstrap

test/fixtures/foo.js:1427–1454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

bootstrapFunction · 0.85

Calls 3

startingTagFunction · 0.85
createInjectorFunction · 0.85
compileFunction · 0.85

Tested by

no test coverage detected