I'd like to delay the response to the following whenGET:
$httpBackend.whenGET(/^foobar/).respond(function () {
return [200,{}];
});
However it seems impossible using $timeout to do this synchronously, so I'm not sure how to approach this?
I'd like to delay the response to the following whenGET:
$httpBackend.whenGET(/^foobar/).respond(function () {
return [200,{}];
});
However it seems impossible using $timeout to do this synchronously, so I'm not sure how to approach this?
If you want to delay only a specific response, than you may delay assignment of the reponse to scope property.
If you wrap your call into your custom service method, than you may wrap the response into the promise and resolve it when needed:
JS:
[EDIT]:
To set the delay to all requests, you may apply this solution to the response interceptor