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

Function setupModuleLoader

lib/test/angular/1.6.7/angular.js:2218–2612  ·  view source on GitHub ↗

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

(window)

Source from the content-addressed store, hash-verified

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

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