Skip to content

Commit 69841d3

Browse files
committed
docs(decorators): remove statements toward module.decorator order
Commit 6a2ebdb removes the caveat of declaring a provider prior to decorating it through the module.decorator function. Remove statements warning of the prior requirement for order of operations. See angular#12382, PR angular#14348, and [angular#14372 comment 206452412] (angular#14372 (comment))
1 parent cfc8b41 commit 69841d3

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

docs/content/guide/decorators.ngdoc

-31
Original file line numberDiff line numberDiff line change
@@ -161,37 +161,6 @@ the end of the name. The `$delegate` provided is dictated by the type of service
161161
This {@link api/ng/type/angular.Module#decorator function} is the same as the `$provide.decorator` function except it is
162162
exposed through the module API. This allows you to separate your decorator patterns from your module config blocks.
163163

164-
Like with `$provide.decorator`, the `module.decorator` function runs during the config phase of the app. That means
165-
you can define a `module.decorator` before the decorated service is defined.
166-
167-
Since you can apply multiple decorators, it is noteworthy that decorator application always follows order
168-
of declaration:
169-
170-
- If a service is decorated by both `$provide.decorator` and `module.decorator`, the decorators are applied in order:
171-
172-
```js
173-
angular
174-
.module('theApp', [])
175-
.factory('theFactory', theFactoryFn)
176-
.config(function($provide) {
177-
$provide.decorator('theFactory', provideDecoratorFn); // runs first
178-
})
179-
.decorator('theFactory', moduleDecoratorFn); // runs seconds
180-
```
181-
182-
- If the service has been declared multiple times, a decorator will decorate the service that has been declared
183-
last:
184-
185-
```js
186-
angular
187-
.module('theApp', [])
188-
.factory('theFactory', theFactoryFn)
189-
.decorator('theFactory', moduleDecoratorFn)
190-
.factory('theFactory', theOtherFactoryFn);
191-
192-
// `theOtherFactoryFn` is selected as 'theFactory' provider and it is decorated via `moduleDecoratorFn`.
193-
```
194-
195164
## Example Applications
196165

197166
The following sections provide examples each of a service decorator, a directive decorator, and a filter decorator.

0 commit comments

Comments
 (0)