From 5dfbce5dffcb0e798b7bd75ac1a10d483d0140e9 Mon Sep 17 00:00:00 2001 From: ajaygm Date: Thu, 5 May 2016 08:40:17 +0530 Subject: [PATCH 1/3] docs($provide): Decorator method in summary Added short description for decorator method and link to it in the summary section. --- src/auto/injector.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auto/injector.js b/src/auto/injector.js index c868639dfa9a..faad98d3379a 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -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)} - registers a **service decorator** with the + * {@link auto.$injector $injector}, `name` the name of the service to decorate. * * See the individual methods for more information and examples. */ From fa721ee981685302a689dd01f35e6a0744530a18 Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 5 May 2016 18:50:55 +0530 Subject: [PATCH 2/3] Style: removed whitespaces --- src/auto/injector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auto/injector.js b/src/auto/injector.js index faad98d3379a..26f60b5b48b3 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -359,8 +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)} - registers a **service decorator** with the - * {@link auto.$injector $injector}, `name` the name of the service to decorate. + * * {@link auto.$provide#decorator decorator(name)} - registers a **service decorator** with the + * {@link auto.$injector $injector}, `name` the name of the service to decorate. * * See the individual methods for more information and examples. */ From 1139bb9e8ab87beb0d02487f983a2e4d4ad4dc01 Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 15 May 2016 14:59:21 +0530 Subject: [PATCH 3/3] docs($provide): Decorator function Decorator function can decorate any type of provider not just services. --- src/auto/injector.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/auto/injector.js b/src/auto/injector.js index 26f60b5b48b3..bd82084da2bc 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -359,8 +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)} - registers a **service decorator** with the - * {@link auto.$injector $injector}, `name` the name of the service to decorate. + * * {@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. */ @@ -617,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 + * 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.} 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.} 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