As a newcomer to Angular, I have noticed that the locals
argument in the controller
function can sometimes be just a function and other times an array.
angular.module('contentful').controller(
'FormWidgetsController',
['$scope', "$injector", function($scope, $injector){ ... }]);
vs.
myModule.controller("GroupController", function GroupController($scope){
...
});
These examples are from one particular source, but when I checked the AngularJS documentation, it didn't provide much context on this topic. Searching online hasn't helped clarify things for me as a beginner.
I would greatly appreciate if someone could explain the distinction between these two approaches and what each implementation achieves.