The idea is to get a data from another source in certain cases, so I have this stub:
factory("interceptor", function ($q, $location, $http) {
return function (promise) {
return promise;
}
}
which fails with
[$injector:cdep] Circular dependency found: interceptor <- $http
Also tried to inject $injector and retrieve $http using that, with same results. Any ideas?
.config is nothing but declaration:
.config(function ($httpProvider) {
$httpProvider.responseInterceptors.push('interceptor');
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…