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

Function angularInit

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

1829 </example>
1830 */
1831function angularInit(element, bootstrap) {
1832 var appElement,
1833 module,
1834 config = {};
1835
1836 // The element `element` has priority over any other element.
1837 forEach(ngAttrPrefixes, function(prefix) {
1838 var name = prefix + 'app';
1839
1840 if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
1841 appElement = element;
1842 module = element.getAttribute(name);
1843 }
1844 });
1845 forEach(ngAttrPrefixes, function(prefix) {
1846 var name = prefix + 'app';
1847 var candidate;
1848
1849 if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
1850 appElement = candidate;
1851 module = candidate.getAttribute(name);
1852 }
1853 });
1854 if (appElement) {
1855 if (!isAutoBootstrapAllowed) {
1856 window.console.error('Angular: disabling automatic bootstrap. <script> protocol indicates ' +
1857 'an extension, document.location.href does not match.');
1858 return;
1859 }
1860 config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
1861 bootstrap(appElement, module ? [module] : [], config);
1862 }
1863}
1864
1865/**
1866 * @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