I have been reading AngularJS code and trying to make sense out of the argument passed to the .config method. From the sample below, it appears to be passing [ ] to .config. The part that perplexes me is that according to angular.Module documentation on docs.angularjs.org, the method config, takes configFn as a parameter which is a function. So why in following example I see that ['$routeProvider', function(..) { .. }] being passed as the argument? Can someone help clarify my confusion?
var sampleApp = angular.module('phonecatApp', []);
sampleApp .config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/addOrder', {
templateUrl: 'templates/add-order.html',
controller: 'AddOrderController'
}).
when('/showOrders', {
templateUrl: 'templates/show-orders.html',
controller: 'ShowOrdersController'
}).
otherwise({
redirectTo: '/addOrder'
});
}]);