-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Using this loader
module: {
loaders: [{
test: /\.js$/,
include: path.resolve(__dirname, 'app/'),
loaders: ['ng-annotate', 'babel-loader']
},
(...)
If my file contains, for example
// @ngInject
function controller($stateParams, session, tiles, organizations) {
let vm = this;
}
It gets compiled to
// @ngInject
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function controller($stateParams, session, tiles, organizations) {
var vm = this;
}
exports["default"] = controller;
module.exports = exports["default"];
Causing the annotation to not work. In contrast, with if the comment is not the first line
let number = 1;
// @ngInject
function controller($stateParams, session, tiles, organizations) {
let vm = this;
}
export default controller;
It compiles well
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var number = 1;
// @ngInject
function controller($stateParams, session, tiles, organizations) {
var vm = this;
}
controller.$inject = ["$stateParams", "session", "tiles", "organizations"];
exports["default"] = controller;
module.exports = exports["default"];
I tried using the "ngInject" syntax and it works. Any suggestion to get the // @ngInject syntax to work as well in this case?
Metadata
Metadata
Assignees
Labels
No labels