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