This rule requires that angular dependencies are specified either first
or last
in a list of
dependencies for controllers, directives, factories, services, providers, configurations and resolve
objects. Both array and function syntax are supported.
angular.module('app').controller('ValidController', function($scope, myService) {
// ...
})
angular.module('app')
.controller('ValidController', ['$scope', 'myService', function($scope, myService) {
// ...
}])
angular.module('app').controller('InvalidController', function(myService, $scope) {
// ...
})
angular.module('app').controller('ValidController', function(myService, $scope) {
// ...
})
angular.module('app').controller('InvalidController', function($scope, myService) {
// ...
})