MCPcopy
hub / github.com/angular-ui/ui-grid / angularInit

Function angularInit

lib/test/angular/1.4.3/angular.js:1520–1547  ·  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

1518 </example>
1519 */
1520function 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

Callers 1

angular.jsFile · 0.70

Calls 3

forEachFunction · 0.70
getNgAttributeFunction · 0.70
bootstrapFunction · 0.70

Tested by

no test coverage detected