Q:

Custom provider within angular .config

I saw a couple of examples how to insert custom providers into angular's .config, but I fail to do it properly. 
I have a provider: 
(function() {
 var app = angular.module('application.providers', ['application.services'])

 app.provider('accessProvider', function() {
     this.$get = ['userServices',
         function(userServices) {
             var auth = {}
             auth.action = function(action, roles) {
                 auth[action] = angular.copy(roles)
             }

             auth.action('sell', [...])

             auth.can = function(action) {
                 var userRole = userServices.getRole()
                 return auth[action].reduce(function(prev, now) {
                     return prev || (now === userRole)
                 }, false)
             }
             return auth
         }
     ]
 })

})()

And when I am defining my routes here: 
 (function() {
var app = angular.module('application.configRoutes', ['ngRoute', 'application.providers'])

app.config(['$routeProvider', '$locationProvider', 'accessProvider',
    function($routeProvider, $locationProvider, accessProvider) {
        ...

I get the following error: 
Uncaught Error: [$injector:modulerr] Failed to instantiate module landingPage due to:
 Error: [$injector:modulerr] Failed to instantiate module application.configRoutes due to:
 Error: [$injector:unpr] Unknown provider: accessProvider

This is how I instantiate my app: 
     var app = angular.module('landingPage', [
    'application.configRoutes',
    'application.directives',
    'application.controllers',
    'application.translate',
    'application.flash',
    'application.customInterceptors'
])

and I load the file storing the services.js before the providers.js and only then I load the configRoutes.js.

A:

Found my problem. I did not append Provider to the provider name. In this case it would look like accessProviderProvider.

