* @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)
| 1579 | </example> |
| 1580 | */ |
| 1581 | function angularInit(element, bootstrap) { |
| 1582 | var appElement, |
| 1583 | module, |
| 1584 | config = {}; |
| 1585 | |
| 1586 | // The element `element` has priority over any other element |
| 1587 | forEach(ngAttrPrefixes, function(prefix) { |
| 1588 | var name = prefix + 'app'; |
| 1589 | |
| 1590 | if (!appElement && element.hasAttribute && element.hasAttribute(name)) { |
| 1591 | appElement = element; |
| 1592 | module = element.getAttribute(name); |
| 1593 | } |
| 1594 | }); |
| 1595 | forEach(ngAttrPrefixes, function(prefix) { |
| 1596 | var name = prefix + 'app'; |
| 1597 | var candidate; |
| 1598 | |
| 1599 | if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { |
| 1600 | appElement = candidate; |
| 1601 | module = candidate.getAttribute(name); |
| 1602 | } |
| 1603 | }); |
| 1604 | if (appElement) { |
| 1605 | config.strictDi = getNgAttribute(appElement, "strict-di") !== null; |
| 1606 | bootstrap(appElement, module ? [module] : [], config); |
| 1607 | } |
| 1608 | } |
| 1609 | |
| 1610 | /** |
| 1611 | * @ngdoc function |
no test coverage detected