Closed mattlewis92 closed 8 years ago
having the same problem, I had to remove the decorator
from the chain otherwise ng-annotate
ignores the module entirely:
var app = angular.module('moduleName', []);
app.decorator('serviceName', [/* service names */ function(/* services */) {
});
+1
As a temporal solution, you can mark the function to be annotated with
app.decorator('serviceName', function($delegate, and, others) {
'ngInject';
// decorator code
return $delegate;
});
See more info for why this has been the case in #82. I'll change the code to support foo.decorator("yo", function() ...)
generically with an exception for $stateProvider.decorator(...)
instead. Will be out in next release.
released in 1.1.0
Angular 1.4 introduced a new decorator helper with the pattern:
However it's not currently automatically annotated.