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

Function angularInit

lib/test/angular/1.7.0/angular.js:1799–1831  ·  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

1797 </example>
1798 */
1799function angularInit(element, bootstrap) {
1800 var appElement,
1801 module,
1802 config = {};
1803
1804 // The element `element` has priority over any other element.
1805 forEach(ngAttrPrefixes, function(prefix) {
1806 var name = prefix + 'app';
1807
1808 if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
1809 appElement = element;
1810 module = element.getAttribute(name);
1811 }
1812 });
1813 forEach(ngAttrPrefixes, function(prefix) {
1814 var name = prefix + 'app';
1815 var candidate;
1816
1817 if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
1818 appElement = candidate;
1819 module = candidate.getAttribute(name);
1820 }
1821 });
1822 if (appElement) {
1823 if (!isAutoBootstrapAllowed) {
1824 window.console.error('AngularJS: disabling automatic bootstrap. <script> protocol indicates ' +
1825 'an extension, document.location.href does not match.');
1826 return;
1827 }
1828 config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
1829 bootstrap(appElement, module ? [module] : [], config);
1830 }
1831}
1832
1833/**
1834 * @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