You can interrupt calls $httpusing the configuration property timeout, which can be a promise that interrupts the request when it is resolved.
So in restangular you can do this for example
var abort = $q.defer();
Restangular.one('foos', 12345).withHttpConfig({timeout: abort.promise}).get();
abort.resolve();
Hope this helps!
jakee source
share