This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs($provide): Decorator method in summary #14562
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,6 +359,8 @@ function annotate(fn, strictDi, name) { | |
* * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class` | ||
* that will be wrapped in a **service provider** object, whose `$get` property will instantiate | ||
* a new object using the given constructor function. | ||
* * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function**, | ||
* `decorFn`, with the {@link auto.$injector $injector}, `name` the name of the provider to decorate. | ||
* | ||
* See the individual methods for more information and examples. | ||
*/ | ||
|
@@ -615,18 +617,18 @@ function annotate(fn, strictDi, name) { | |
* @name $provide#decorator | ||
* @description | ||
* | ||
* Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator | ||
* intercepts the creation of a service, allowing it to override or modify the behavior of the | ||
* service. The object returned by the decorator may be the original service, or a new service | ||
* object which replaces or wraps and delegates to the original service. | ||
* Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function | ||
* intercepts the creation of a provider, allowing it to override or modify the behavior of the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. provider, -> provider (and also directives and filters), |
||
* provider. The object returned by the decorator may be the original provider, or a new provider | ||
* object which replaces or wraps and delegates to the original provider. | ||
* | ||
* @param {string} name The name of the service to decorate. | ||
* @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be | ||
* instantiated and should return the decorated service instance. The function is called using | ||
* @param {string} name The name of the provider to decorate. | ||
* @param {Function|Array.<string|Function>} decorator This function will be invoked when the provider needs to be | ||
* instantiated and should return the decorated provider instance. The function is called using | ||
* the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. | ||
* Local injection arguments: | ||
* | ||
* * `$delegate` - The original service instance, which can be monkey patched, configured, | ||
* * `$delegate` - The original provider instance, which can be monkey patched, configured, | ||
* decorated or delegated to. | ||
* | ||
* @example | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
,
name
the name of the provider to decorate. -> ;name
is the name of the provider to decorate.