title: Injecting Dependencies in config() modules - AngularJS
body: <p>Currently in app.js i have the following routes:</p>
  
  <pre><code>var gm = angular.module('gm', ['gm.services','gm.directives','gm.filters','gm.controllers','ngSanitize']);
  
  gm.config(['$routeProvider', 'Path', function($routeProvider, Path) {
  
      $routeProvider.when('/login', { 
          templateUrl: Path.view('application/authentication/login.html'), 
          controller: 'authController' 
      });
  
      $routeProvider.when('/dashboard', { 
          templateUrl: Path.view('application/dashboard/index.html'), 
          controller: 'dashboardController' 
      }); 
  
      $routeProvider.otherwise({ 
          redirectTo: '/login'
      });
  
  }]);
  </code></pre>
  
  <p>I'm trying to inject the Path dependency as you can see. Although i get an error saying it can't find this provider. I think this is because config module providers are executed first before anything else. below is my Path provider definition in "services.js"</p>
  
  <pre><code>gm.factory("Path", function() {
    return {
      view: function(path) {
        return 'app/views/' + path; 
      },
      css: function(path) {
        return 'app/views/' + path; 
      },
      font: function(path) {
        return 'app/views/' + path; 
      },
      img: function(path) {
        return 'app/views/' + path; 
      },
      js: function(path) {
        return 'app/views/' + path; 
      },
      vendor: function(path) {
        return 'app/views/' + path; 
      },
      base: function(path) {
        return '/' + path; 
      }
    }
  }); 
  </code></pre>
  
  <p>how can i inject this provider into a config module?</p>