MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / doBootstrap

Function doBootstrap

web/static/bower_components/angular/angular.js:1632–1667  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1630 };
1631 config = extend(defaultConfig, config);
1632 var doBootstrap = function() {
1633 element = jqLite(element);
1634
1635 if (element.injector()) {
1636 var tag = (element[0] === document) ? 'document' : startingTag(element);
1637 //Encode angle brackets to prevent input from being sanitized to empty string #8683
1638 throw ngMinErr(
1639 'btstrpd',
1640 "App Already Bootstrapped with this Element '{0}'",
1641 tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1642 }
1643
1644 modules = modules || [];
1645 modules.unshift(['$provide', function($provide) {
1646 $provide.value('$rootElement', element);
1647 }]);
1648
1649 if (config.debugInfoEnabled) {
1650 // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
1651 modules.push(['$compileProvider', function($compileProvider) {
1652 $compileProvider.debugInfoEnabled(true);
1653 }]);
1654 }
1655
1656 modules.unshift('ng');
1657 var injector = createInjector(modules, config.strictDi);
1658 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
1659 function bootstrapApply(scope, element, compile, injector) {
1660 scope.$apply(function() {
1661 element.data('$injector', injector);
1662 compile(element)(scope);
1663 });
1664 }]
1665 );
1666 return injector;
1667 };
1668
1669 var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
1670 var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;

Callers 1

bootstrapFunction · 0.85

Calls 3

startingTagFunction · 0.85
createInjectorFunction · 0.85
compileFunction · 0.85

Tested by

no test coverage detected