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