I set up the configuration for my main module in the following way:
angular.module('main').config(function($routeProvider, $locationProvider
, ConfigProvider)
{
$routeProvider
.when('/home',
{
templateUrl : ConfigProvider.path.views +
'/page/home.html',
controller : 'PageHomeCtrl',
resolve : {
resolveHomeData : function(ResolveService) { return
ResolveService.resolveHome() }
}
});
$locationProvider.html5Mode(true);
}
);
The ResolveService takes care of resolving the routes and at the moment is
very simple:
angular.module('app.resolve').factory('ResolveService', function($q,
UserService)
{
return {
resolveHome : function()
{
var deferred = $q.defer();
UserService.find('me', function(data)
{
deferred.resolve(data);
}, function(data, status)
{
deferred.reject(data);
});
return deferred.promise;
}
}
});
This instead is the PageHomeCtrl:
angular.module('app.ui.page.home').controller('PageHomeCtrl', function(
$q, $scope, UserService, resolveHomeData)
{
});
As you can see I'm injecting the `resolveHomeData` in it but I get the
following error from AngularJS:
Unknown provider: resolveHomeDataProvider
Why is resolveHomeData not injected correctly into my controller?
I'm concatenating everything with a Gulp script and I'm including all
AngularJS files in the following order:
1. Modules definitions
2. Modules configurations
3. Providers
4. Controllers
5. Directives
6. Filters
7. Services
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.