2 ms·
You don't need to use angular's inline injection annotations if you don't want to. Angular can figure out the needed injection by the parameter name. This cau
by mbell 13y ago
You don't need to use angular's inline injection annotations if you don't want to. Angular can figure out the needed injection by the parameter name. This causes an issue when you minimize your code but ngmin solves that problem: https://github.com/btford/ngmin https://github.com/btford/ngmin
For example:
angular.module('app').controller('someController', function ($scope, ModelService, AuthService) {
$scope.something = 'Blah';
});
Works just fine as long as it isn't minimized, and ngmin would turn it into something like:
angular.module('app').controller('someController', ['$scope', 'ModelService', 'AuthService', function ($scope, ModelService, AuthService) {
$scope.something = 'Blah';
}]);
Which is then safe to run through a minimizer.