* @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)
| 1343 | </example> |
| 1344 | */ |
| 1345 | function angularInit(element, bootstrap) { |
| 1346 | var appElement, |
| 1347 | module, |
| 1348 | config = {}; |
| 1349 | |
| 1350 | // The element `element` has priority over any other element |
| 1351 | forEach(ngAttrPrefixes, function(prefix) { |
| 1352 | var name = prefix + 'app'; |
| 1353 | |
| 1354 | if (!appElement && element.hasAttribute && element.hasAttribute(name)) { |
| 1355 | appElement = element; |
| 1356 | module = element.getAttribute(name); |
| 1357 | } |
| 1358 | }); |
| 1359 | forEach(ngAttrPrefixes, function(prefix) { |
| 1360 | var name = prefix + 'app'; |
| 1361 | var candidate; |
| 1362 | |
| 1363 | if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { |
| 1364 | appElement = candidate; |
| 1365 | module = candidate.getAttribute(name); |
| 1366 | } |
| 1367 | }); |
| 1368 | if (appElement) { |
| 1369 | config.strictDi = getNgAttribute(appElement, "strict-di") !== null; |
| 1370 | bootstrap(appElement, module ? [module] : [], config); |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | /** |
| 1375 | * @ngdoc function |
no test coverage detected