Closed ersimont closed 9 years ago
ng-annotate doesn't like that you declare the array twice but it does report an helpful error:
~/projects/ng-annotate/tests-issues % ng-annotate -a issue192.js
error: conflicting inject arrays at line 3 and 7
If you don't see this error message when using gulp then that's a bug so then please open an issue on gulp-ng-annotate.
If you need to have the duplicate arrays then just tell ng-annotate that you don't want it to annotate the controller
function:
function controller($scope, $element, $attrs) {
"ngNoInject";
// important stuff here
}
I'm using
gulp-ng-annotate
. I had some silly code that defined$inject
for a directive's controller twice (oops!). The only behavior I saw, though, was that when I addedngAnnotate()
to my gulpfile suddenly everything stopped working, without any error message. I added/removed files from my build process to narrow it down, then comment/uncomment code until I found the issue.I'm guessing "silently fail" is not the desired behavior. My first guess is that the issue is here in
ng-annotate
, but I will happily move this report over togulp-ng-annotate
if everything is OK on your end.Here is a small example that will trigger the issue: