@@ -79,6 +79,9 @@ function setupModuleLoader(window) {
7979 * @returns {angular.Module } new module with the {@link angular.Module} api.
8080 */
8181 return function module ( name , requires , configFn ) {
82+
83+ var info = { } ;
84+
8285 var assertNotHasOwnProperty = function ( name , context ) {
8386 if ( name === 'hasOwnProperty' ) {
8487 throw ngMinErr ( 'badname' , 'hasOwnProperty is not a valid {0} name' , context ) ;
@@ -114,6 +117,45 @@ function setupModuleLoader(window) {
114117 _configBlocks : configBlocks ,
115118 _runBlocks : runBlocks ,
116119
120+ /**
121+ * @ngdoc method
122+ * @name angular.Module#info
123+ * @module ng
124+ *
125+ * @param {Object= } info Information about the module
126+ * @returns {Object|Module } The current info object for this module if called as a getter,
127+ * or `this` if called as a setter.
128+ *
129+ * @description
130+ * Read and write custom information about this module.
131+ * For example you could put the version of the module in here.
132+ *
133+ * ```js
134+ * angular.module('myModule', []).info({ version: '1.0.0' });
135+ * ```
136+ *
137+ * The version could then be read back out by accessing the module elsewhere:
138+ *
139+ * ```
140+ * var version = angular.module('myModule').info().version;
141+ * ```
142+ *
143+ * You can also retrieve this information during runtime via the
144+ * {@link $injector#modules `$injector.modules`} property:
145+ *
146+ * ```js
147+ * var version = $injector.modules['myModule'].info().version;
148+ * ```
149+ */
150+ info : function ( value ) {
151+ if ( isDefined ( value ) ) {
152+ if ( ! isObject ( value ) ) throw ngMinErr ( 'aobj' , 'Argument \'{0}\' must be an object' , 'value' ) ;
153+ info = value ;
154+ return this ;
155+ }
156+ return info ;
157+ } ,
158+
117159 /**
118160 * @ngdoc property
119161 * @name angular.Module#requires
0 commit comments