When using the following code angularjs-annotate fails to annotate the class if the class is transpiled to ES5
/*@ngInject*/
export class Broken {
constructor($q) {
}
}box chec
The problem can be reproduced on the demo page https://schmod.github.io/babel-plugin-angularjs-annotate/ with the transform checkbox checked
Note that this works fine if the class is not exported.
I found several alternative placement of the @ngInject that work.
export /*@ngInject*/ class Ok {
constructor($q) {
}
}
export class Ok2 {
/*@ngInject*/
constructor($q) {
}
}
It 1 also works if I use an alias for export
/* @ngInject */
class MyControllerInternal {
constructor($q) {}
}
export const MyController = MyControllerInternal;
When using the following code angularjs-annotate fails to annotate the class if the class is transpiled to ES5
The problem can be reproduced on the demo page https://schmod.github.io/babel-plugin-angularjs-annotate/ with the transform checkbox checked
Note that this works fine if the class is not exported.
I found several alternative placement of the @ngInject that work.
It 1 also works if I use an alias for export