title: Getting error "Failed to instantiate module app due to unknown provider" with my custom provider
body: <p>Trying to create custom provider and use it during app config. During configuration phase getting an error "Failed to instantiate module app due to unknown provider 'configRoutesProvider'".
  Provider code: </p>
  
  <pre><code>    (function () {
      'use strict';
  
      angular.module('app-routing', [])
          .provider('configRoutesProvider', function () {
  
              this.$get = ['$http', getRoutesProvider];
  
              function getRoutesProvider($http) {
                  return {
                      getRoutes: function ($http) {
                          return $http.get('https://localhost:44311/api/account/routes').then(function (results) {
                              return results;
                          });
                      }
                  };
              }
          });
  }).call(this);
  </code></pre>
  
  <p>In app.js code get a reference to the 'app-routing' module:</p>
  
  <pre><code>(function () {
      'use strict';
      var app = angular.module('app',
              [
                  'ngRoute',              // routing
                  'LocalStorageModule',   // local storage
  
                  'app-routing'
              ]);
  
  
          app.run();
  })();
  </code></pre>
  
  <p>And in config.js when trying to reference the provider get the above error:</p>
  
  <pre><code>app.config(['$routeProvider', 'configRoutesProvider', routeConfigurator]);
      function routeConfigurator($routeProvider, configRoutesProvider) {
          var routes = configRoutesProvider.getRoutes();
          routes.forEach(function (r) {
              $routeProvider.when(r.href, {
                  controller: r.controller,
                  templateUrl: r.templateUrl
              });
          });
          $routeProvider.otherwise({ redirectTo: '/home' });
  
      }
  </code></pre>
  
  <p>In index.html the order of scripts registration is following:</p>
  
  <pre><code>&lt;script src="app/routesProvider.js"&gt;&lt;/script&gt;
  &lt;!-- Load app main script --&gt;
  &lt;script src="app/app.js"&gt;&lt;/script&gt;
  &lt;script src="app/config.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Can't understand what I miss?</p>