I have seen people using arrays in parameters like so
myAngularApp.controller("nameOfController", ["$firstDependency", "$secondDependency", function ($firstDependency, $secondDependency) {
// code here
}]);
On the other hands I have seen the following code too, and both are working
myAngularApp.controller("nameOfController", function ($firstDependency, $secondDependency) {
// code here
});
In angular documentation I see the use of arrays. Why is angular allowing the latter method? Which one is absolute recommendation? In fact, in angular documentation samples, the directives don't use arrays.
