* @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)
| 1518 | </example> |
| 1519 | */ |
| 1520 | function angularInit(element, bootstrap) { |
| 1521 | var appElement, |
| 1522 | module, |
| 1523 | config = {}; |
| 1524 | |
| 1525 | // The element `element` has priority over any other element |
| 1526 | forEach(ngAttrPrefixes, function(prefix) { |
| 1527 | var name = prefix + 'app'; |
| 1528 | |
| 1529 | if (!appElement && element.hasAttribute && element.hasAttribute(name)) { |
| 1530 | appElement = element; |
| 1531 | module = element.getAttribute(name); |
| 1532 | } |
| 1533 | }); |
| 1534 | forEach(ngAttrPrefixes, function(prefix) { |
| 1535 | var name = prefix + 'app'; |
| 1536 | var candidate; |
| 1537 | |
| 1538 | if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { |
| 1539 | appElement = candidate; |
| 1540 | module = candidate.getAttribute(name); |
| 1541 | } |
| 1542 | }); |
| 1543 | if (appElement) { |
| 1544 | config.strictDi = getNgAttribute(appElement, "strict-di") !== null; |
| 1545 | bootstrap(appElement, module ? [module] : [], config); |
| 1546 | } |
| 1547 | } |
| 1548 | |
| 1549 | /** |
| 1550 | * @ngdoc function |
no test coverage detected