In Angular, we can inject $routeProvider
to the config
function
module.config(function ($routeProvider) {
});
I
You can do it like this:
(function() {
'use strict';
angular.module('name', name).config(config);
// You can do this:
config.$inject = ['$routeProvider', 'myService'];
function config($routeProvider, myService) {
// Or better to use this, but you need to use ng-annotate:
/* ngInject */
}
});
It is best practice that is described here