* @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)
| 1326 | </example> |
| 1327 | */ |
| 1328 | function angularInit(element, bootstrap) { |
| 1329 | var appElement, |
| 1330 | module, |
| 1331 | config = {}; |
| 1332 | |
| 1333 | // The element `element` has priority over any other element |
| 1334 | forEach(ngAttrPrefixes, function(prefix) { |
| 1335 | var name = prefix + 'app'; |
| 1336 | |
| 1337 | if (!appElement && element.hasAttribute && element.hasAttribute(name)) { |
| 1338 | appElement = element; |
| 1339 | module = element.getAttribute(name); |
| 1340 | } |
| 1341 | }); |
| 1342 | forEach(ngAttrPrefixes, function(prefix) { |
| 1343 | var name = prefix + 'app'; |
| 1344 | var candidate; |
| 1345 | |
| 1346 | if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { |
| 1347 | appElement = candidate; |
| 1348 | module = candidate.getAttribute(name); |
| 1349 | } |
| 1350 | }); |
| 1351 | if (appElement) { |
| 1352 | config.strictDi = getNgAttribute(appElement, "strict-di") !== null; |
| 1353 | bootstrap(appElement, module ? [module] : [], config); |
| 1354 | } |
| 1355 | } |
| 1356 | |
| 1357 | /** |
| 1358 | * @ngdoc function |
no test coverage detected