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