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

Function setupModuleLoader

lib/test/angular/1.5.0/angular.js:1933–2284  ·  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

1931 */
1932
1933function setupModuleLoader(window) {
1934
1935 var $injectorMinErr = minErr('$injector');
1936 var ngMinErr = minErr('ng');
1937
1938 function ensure(obj, name, factory) {
1939 return obj[name] || (obj[name] = factory());
1940 }
1941
1942 var angular = ensure(window, 'angular', Object);
1943
1944 // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
1945 angular.$$minErr = angular.$$minErr || minErr;
1946
1947 return ensure(angular, 'module', function() {
1948 /** @type {Object.<string, angular.Module>} */
1949 var modules = {};
1950
1951 /**
1952 * @ngdoc function
1953 * @name angular.module
1954 * @module ng
1955 * @description
1956 *
1957 * The `angular.module` is a global place for creating, registering and retrieving Angular
1958 * modules.
1959 * All modules (angular core or 3rd party) that should be available to an application must be
1960 * registered using this mechanism.
1961 *
1962 * Passing one argument retrieves an existing {@link angular.Module},
1963 * whereas passing more than one argument creates a new {@link angular.Module}
1964 *
1965 *
1966 * # Module
1967 *
1968 * A module is a collection of services, directives, controllers, filters, and configuration information.
1969 * `angular.module` is used to configure the {@link auto.$injector $injector}.
1970 *
1971 * ```js
1972 * // Create a new module
1973 * var myModule = angular.module('myModule', []);
1974 *
1975 * // register a new service
1976 * myModule.value('appName', 'MyCoolApp');
1977 *
1978 * // configure existing services inside initialization blocks.
1979 * myModule.config(['$locationProvider', function($locationProvider) {
1980 * // Configure existing providers
1981 * $locationProvider.hashPrefix('!');
1982 * }]);
1983 * ```
1984 *
1985 * Then you can create an injector and load your modules like this:
1986 *
1987 * ```js
1988 * var injector = angular.injector(['ng', 'myModule'])
1989 * ```
1990 *

Callers 1

publishExternalAPIFunction · 0.70

Calls 5

minErrFunction · 0.70
ensureFunction · 0.70
assertNotHasOwnPropertyFunction · 0.70
invokeLaterFunction · 0.70

Tested by

no test coverage detected