MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / angularInit

Function angularInit

code/songhop/www/lib/angular/angular.js:1328–1355  ·  view source on GitHub ↗

* @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)

Source from the content-addressed store, hash-verified

1326 </example>
1327 */
1328function 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

Callers 1

angular.jsFile · 0.70

Calls 3

forEachFunction · 0.70
getNgAttributeFunction · 0.70
bootstrapFunction · 0.70

Tested by

no test coverage detected