I am encountering an issue with my module setup involving core, util, and test.
- The util module has no dependencies and one provider
- The test module depends on util and core, and has one controller
- The core module depends on util, and has a provider that uses a provider from util
When I try to initialize the core module, I receive an error because it cannot find the provider from util. If I remove this provider injection, everything works as expected.
I am unsure of what mistake I might be making.
var util = angular.module('util', []);
var core = angular.module('core', ['util']);
var test = angular.module('test', ['core', 'util']);
core.provider('core.OC', ['util.Path', function(Path){
this.$get = function(){
return {
get: function() { return 'OC!';}
}
};
}]);
util.provider('util.Path', function(){
this.$get = function(){
return {
get: function() { return 'Path!';}
}
};
});
test.controller('MainCtrl', ['$scope','util.Path', function($scope, Path) {
$scope.name = Path.get();
}]);
For reference, here is a plnkr link demonstrating this setup: http://plnkr.co/edit/7VhdrdleNXHqqucSUcv9