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 fu
$injector to interceptor:Use it to get $http inside the returned object within callback functions.
Here is an example
app.config(function ($httpProvider) {
$httpProvider.interceptors.push('interceptor');
});
app.factory("interceptor", function ($q, $location, $injector) {
return {
request: function(config){
var $http = $injector.get('$http');
console.dir($http);
return config;
}
}
});
app.run(function($http){
$http.get('/')
});