MCPcopy Index your code
hub / github.com/angular-ui/ui-router / setupModuleLoader

Function setupModuleLoader

test/angular/1.6/angular.js:2228–2628  ·  view source on GitHub ↗

* @ngdoc type * @name angular.Module * @module ng * @description * * Interface for configuring AngularJS angular.module modules.

(window)

Source from the content-addressed store, hash-verified

2226 */
2227
2228function setupModuleLoader(window) {
2229
2230 var $injectorMinErr = minErr('$injector');
2231 var ngMinErr = minErr('ng');
2232
2233 function ensure(obj, name, factory) {
2234 return obj[name] || (obj[name] = factory());
2235 }
2236
2237 var angular = ensure(window, 'angular', Object);
2238
2239 // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
2240 angular.$$minErr = angular.$$minErr || minErr;
2241
2242 return ensure(angular, 'module', function() {
2243 /** @type {Object.<string, angular.Module>} */
2244 var modules = {};
2245
2246 /**
2247 * @ngdoc function
2248 * @name angular.module
2249 * @module ng
2250 * @description
2251 *
2252 * The `angular.module` is a global place for creating, registering and retrieving AngularJS
2253 * modules.
2254 * All modules (AngularJS core or 3rd party) that should be available to an application must be
2255 * registered using this mechanism.
2256 *
2257 * Passing one argument retrieves an existing {@link angular.Module},
2258 * whereas passing more than one argument creates a new {@link angular.Module}
2259 *
2260 *
2261 * # Module
2262 *
2263 * A module is a collection of services, directives, controllers, filters, and configuration information.
2264 * `angular.module` is used to configure the {@link auto.$injector $injector}.
2265 *
2266 * ```js
2267 * // Create a new module
2268 * var myModule = angular.module('myModule', []);
2269 *
2270 * // register a new service
2271 * myModule.value('appName', 'MyCoolApp');
2272 *
2273 * // configure existing services inside initialization blocks.
2274 * myModule.config(['$locationProvider', function($locationProvider) {
2275 * // Configure existing providers
2276 * $locationProvider.hashPrefix('!');
2277 * }]);
2278 * ```
2279 *
2280 * Then you can create an injector and load your modules like this:
2281 *
2282 * ```js
2283 * var injector = angular.injector(['ng', 'myModule'])
2284 * ```
2285 *

Callers 1

publishExternalAPIFunction · 0.70

Calls 7

minErrFunction · 0.70
ensureFunction · 0.70
assertNotHasOwnPropertyFunction · 0.70
invokeLaterFunction · 0.70
isDefinedFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected