Closed al-the-x closed 9 years ago
:+1:
So is that a yes? I noted in a recent project that injectables chained after .decorator
were also not decorated, e.g.
angular.module('module')
.config(function($someProvider){
// gets annotated
})
.decorator(function(someService){
// not annotated
})
.controller('SomeController', function(){
// also not annotated
})
// nothing else annotated
I worked around the problem by sticking the decorator at the end of the chain and using /* @ngInject */
comments in front of it.
It was not exactly a yes, rather a I've observed the same behaviour and would love to have this fixed, so that ngAnnotate
will properly recognize angular.decorator()
as well.
(But I tried to be laconic :smile:)
The current behavior is that ng-annotate only supports $provider.decorator
. See the linked issues for further explanation of why.
@olov, I am not at all familiar with the inner workings of ngAnnotate
, but wouldn't it be possible to differentiate Module
's decorator
from other decorators
?
Without doing some fairly complicated static analysis of the input, I'm not
so sure. The previous issues I referenced point to some difficulty
resolving the receiver of the decorator
method as an actual module
instance, so I assume there's no such analysis being done at the moment.
All in all, probably not worth the effort.
On Jul 17, 2015 4:44 PM, "Georgios Kalpakas" notifications@github.com
wrote:
@olov https://github.com/olov, I am not at all familiar with the inner workings of ngAnnotate, but wouldn't it be possible to differentiate Module's decorator from other decorators ?
— Reply to this email directly or view it on GitHub https://github.com/olov/ng-annotate/issues/181#issuecomment-122408437.
:+1: It would be great, if angular module's decorator would work!
I can see from previous issues (#82 and #108) that
decorator
functions that don't belong to Angular are not decorated... Is the current behavior to annotate only$provider.decorator
and notModule.decorator
...?