Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e7ac65b

Browse files
committed
Add provider.$decorator to angular.Module
Allow for decorators to be added prior to the angular.config process. Use case: I am working on a project using ui.router and would like to modify the $stateProvide.state service and would like to ensure that my modification will always be applied prior to any angular.config blocks which could contain $stateProvide.state requests. This would also allow any decorators to be clearly delineated in your code and not lost in a config block.
1 parent 1fc87e2 commit e7ac65b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/loader.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ function setupModuleLoader(window) {
192192
* See {@link auto.$provide#constant $provide.constant()}.
193193
*/
194194
constant: invokeLater('$provide', 'constant', 'unshift'),
195+
196+
/**
197+
* @ngdoc method
198+
* @name angular.Module#decorator
199+
* @module ng
200+
* @param {string} name service name
201+
* @param {Function} providerType Construction function for creating new instance of the
202+
* service.
203+
* @description
204+
* See {@link auto.$provide#decorator $provide.decorator()}.
205+
*/
206+
decorator: invokeLater('$provide', 'decorator'),
195207

196208
/**
197209
* @ngdoc method

0 commit comments

Comments
 (0)