eslint-plugin-angular
eslint-plugin-angular copied to clipboard
di, di-order and di-unused don't work with modules in variables
The following syntax produces errors as expected:
angular.module('MyModule').controller('MyCtrl', function(Zulu, Alpha, Bravo) {
Bravo.something();
});
Throws
- di: use array syntax
- di-order: injected dependecies should be in alphabetical order
- di-unused: Zulu and Alpha unused
But the following code passes fine:
(function(ngModule) {
ngModule.controller('MyCtrl', function(Zulu, Alpha, Bravo) {
Bravo.something();
});
})(angular.module('MyModule'));
I would expect both pieces of code to throw the same error.
You are right. It should throw errors.