请参阅angular中的模块/工厂的依赖关系树

时间:2016-05-29 09:59:16

标签: angularjs dependency-injection dependencies

这是问题所在。我有一个someModuleA可以访问theFactoryOfInterestX

angular.module('someModuleA', ['someModuleB', 'someModuleC', ... /*someModuleZ not here*/])

.controller('controllerFromA', ['theFactoryOfInterestX', , function(theFactoryOfInterestX) {
    console.log(theFactoryOfInterestX); // that factory is available here
}]);

我知道theFactoryOfInterestX仅在someModuleZ

中定义的事实
angular.module('someModuleA', [/*stuff*/])

.factory('theFactoryOfInterestX', [function() { /*definition*/ }]);

那么,很明显['someModuleB', 'someModuleC', ...]的依赖模块someModuleA必须在某个时间点依赖于someModuleZ吗?如果是,这是一个令人惊讶的事实,我需要调查依赖性如何导致someModuleZ。我该怎么做?有没有办法看到角度的依赖图?

0 个答案:

没有答案
相关问题