I want to intercept every call and invoke passtTrough() on all of them , logging the details.
something like :
$httpBackend.whenGET(/\/*/).respond(function(method, url, data, headers) {
if(!condition){
//call passThrough()
}else{
//return my mocked object
return [200, MyTest, {/*headers*/}];
}
}
But the API for $httpBackend.whenGET only lets you either call passThrough() or respond()
What Estus said in the comments worked.
decorate $httpBackend function and/or its methods, similarly to that stackoverflow.com/a/43329519/3731501 . – estus Jul 11 at 19:34