MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / angularInit

Function angularInit

OpenReservation/wwwroot/Scripts/angular.js:1546–1575  ·  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

(element, bootstrap)

Source from the content-addressed store, hash-verified

1544 </example>
1545 */
1546 function angularInit(element, bootstrap) {
1547 var appElement,
1548 module,
1549 config = {};
1550
1551 // The element `element` has priority over any other element
1552 forEach(ngAttrPrefixes,
1553 function (prefix) {
1554 var name = prefix + 'app';
1555
1556 if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
1557 appElement = element;
1558 module = element.getAttribute(name);
1559 }
1560 });
1561 forEach(ngAttrPrefixes,
1562 function (prefix) {
1563 var name = prefix + 'app';
1564 var candidate;
1565
1566 if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
1567 appElement = candidate;
1568 module = candidate.getAttribute(name);
1569 }
1570 });
1571 if (appElement) {
1572 config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
1573 bootstrap(appElement, module ? [module] : [], config);
1574 }
1575 }
1576
1577 /**
1578 * @ngdoc function

Callers 1

angular.jsFile · 0.85

Calls 3

forEachFunction · 0.85
getNgAttributeFunction · 0.85
bootstrapFunction · 0.85

Tested by

no test coverage detected