Open filipesilva opened 9 years ago
@filipesilva Hello! The reason is that Babel adds "use strict"; line in each file by default and you got this:
// @ngInject
"use strict";
function controller($stateParams, session, tiles, organizations) {
var vm = this;
}
Sorry but I haven't workaround for this. Also I have never seen such problem with my code because my files always has imports in top. You can vote up the original issue in Babel: https://github.com/babel/babel/issues/2391
I figured as much. Ah well, "ngInject"
it is for now.
For those of you having some trouble getting the comment to work, try /** @ngInject */
. Most minifiers will ignore comments starting with two *
's .
Also I find that babel may drop comments, but you can set option comments: true
and it will works
Using this loader
If my file contains, for example
It gets compiled to
Causing the annotation to not work. In contrast, with if the comment is not the first line
It compiles well
I tried using the
"ngInject"
syntax and it works. Any suggestion to get the// @ngInject
syntax to work as well in this case?