I want to inject a service into app.config, so that data can be retrieved before the controller is called. I tried it like this:

Service:

```
app.service('dbService', function() {
    return {
        getData: function($q, $http) {
            var defer = $q.defer();
            $http.get('db.php/score/getData').success(function(data) {
                defer.resolve(data);            
            });
            return defer.promise;
        }
    };
});

```

Config:

```
app.config(function ($routeProvider, dbService) {
    $routeProvider
        .when('/',
        {
            templateUrl: "partials/editor.html",
            controller: "AppCtrl",
            resolve: {
                data: dbService.getData(),
            }
        })
});

```

But I get this error:

> 
> Error: Unknown provider: dbService from EditorApp
> 
> 
> 

How to correct setup and inject this service?