I have been following a few tutorials about AngularJS and I noticed that there are multiple methods to initialize a Controller.
For example, the following code is based on the AngularJS documentation:
angular.module('todoList', [])
.controller('todoListCtrl', ['$scope',
function ($scope) {
...
}
]);
However, this code also works:
angular.module('todoList', [])
.controller('todoListCtrl',
function ($scope) {
...
}
);
Is one method preferred over the other?