MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / angularInit

Function angularInit

lib/test/angular/1.5.0/angular.js:1581–1608  ·  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

1579 </example>
1580 */
1581function angularInit(element, bootstrap) {
1582 var appElement,
1583 module,
1584 config = {};
1585
1586 // The element `element` has priority over any other element
1587 forEach(ngAttrPrefixes, function(prefix) {
1588 var name = prefix + 'app';
1589
1590 if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
1591 appElement = element;
1592 module = element.getAttribute(name);
1593 }
1594 });
1595 forEach(ngAttrPrefixes, function(prefix) {
1596 var name = prefix + 'app';
1597 var candidate;
1598
1599 if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
1600 appElement = candidate;
1601 module = candidate.getAttribute(name);
1602 }
1603 });
1604 if (appElement) {
1605 config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
1606 bootstrap(appElement, module ? [module] : [], config);
1607 }
1608}
1609
1610/**
1611 * @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