When JavaScript is minimized, parameter names often change to something shorter, like a . This will break the dependency injection.
If you use an array, Angular knows what to enter and where to enter it. This works with an array because the string elements of the array are not modified by minification.
In this example:
app.controller('test', function( $scope, $someProvider ) { });
The shortened code may look something like this:
app.controller('test',function(a,b){});
This will no longer work, since Angular does not know what to enter, but at the same time:
app.controller('test', ['$scope', '$someProvider', function( $scope, $someProvider) { }]);
the abbreviated code may end as follows:
app.controller('test',['$scope','$someProvider',function(a,b) {}]);
This will work anyway, because Angular still knows what to type. See the note on minimization in the Angular tutorial .
Usually I just add an array style when I'm ready for production.