MCPcopy Index your code
hub / github.com/angular-ui/ui-router / doBootstrap

Function doBootstrap

test/angular/1.4/angular.js:1668–1703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1666 };
1667 config = extend(defaultConfig, config);
1668 var doBootstrap = function() {
1669 element = jqLite(element);
1670
1671 if (element.injector()) {
1672 var tag = (element[0] === document) ? 'document' : startingTag(element);
1673 //Encode angle brackets to prevent input from being sanitized to empty string #8683
1674 throw ngMinErr(
1675 'btstrpd',
1676 "App already bootstrapped with this element '{0}'",
1677 tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1678 }
1679
1680 modules = modules || [];
1681 modules.unshift(['$provide', function($provide) {
1682 $provide.value('$rootElement', element);
1683 }]);
1684
1685 if (config.debugInfoEnabled) {
1686 // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
1687 modules.push(['$compileProvider', function($compileProvider) {
1688 $compileProvider.debugInfoEnabled(true);
1689 }]);
1690 }
1691
1692 modules.unshift('ng');
1693 var injector = createInjector(modules, config.strictDi);
1694 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
1695 function bootstrapApply(scope, element, compile, injector) {
1696 scope.$apply(function() {
1697 element.data('$injector', injector);
1698 compile(element)(scope);
1699 });
1700 }]
1701 );
1702 return injector;
1703 };
1704
1705 var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
1706 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