Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
There was an error while loading. Please reload this page.
Use case is we started a new $http request, and therefore needs to cancel 1 or more previous $http requests.
Eg:
var previousPromises = [];
previousPromises.push($http().then(function(){}));
...
Then:
//previousPromises[0].cancel()
or
//previousPromises[0].reject()
Reference
https://groups.google.com/forum/?fromgroups#!searchin/angular/cancel$20http/angular/aT-MowZoPJg/kPEr5Ja0GEwJ