* @ngdoc directive * @name ngApp * @module ng * * @element ANY * @param {angular.Module} ngApp an optional application * angular.module module name to load. * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be * created in "strict-d
(element, bootstrap)
| 1581 | </example> |
| 1582 | */ |
| 1583 | function angularInit(element, bootstrap) { |
| 1584 | var appElement, |
| 1585 | module, |
| 1586 | config = {}; |
| 1587 | |
| 1588 | // The element `element` has priority over any other element |
| 1589 | forEach(ngAttrPrefixes, function(prefix) { |
| 1590 | var name = prefix + 'app'; |
| 1591 | |
| 1592 | if (!appElement && element.hasAttribute && element.hasAttribute(name)) { |
| 1593 | appElement = element; |
| 1594 | module = element.getAttribute(name); |
| 1595 | } |
| 1596 | }); |
| 1597 | forEach(ngAttrPrefixes, function(prefix) { |
| 1598 | var name = prefix + 'app'; |
| 1599 | var candidate; |
| 1600 | |
| 1601 | if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { |
| 1602 | appElement = candidate; |
| 1603 | module = candidate.getAttribute(name); |
| 1604 | } |
| 1605 | }); |
| 1606 | if (appElement) { |
| 1607 | config.strictDi = getNgAttribute(appElement, "strict-di") !== null; |
| 1608 | bootstrap(appElement, module ? [module] : [], config); |
| 1609 | } |
| 1610 | } |
| 1611 | |
| 1612 | /** |
| 1613 | * @ngdoc function |
no test coverage detected