Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

feat($http): add promise.cancel support #2523

Closed
wants to merge 4 commits into from

Conversation

dbinit
Copy link
Contributor

@dbinit dbinit commented Apr 26, 2013

Implement the canceler option of $q.defer to allow interrupting requests.

Closes #1159

Depends on #2452 and #2503

David Bennett and others added 4 commits April 26, 2013 16:22
Documentation implies that timeout works for all requests, though it
only works with XHR. To implement:
- Change $httpBackend to set a timeout for JSONP requests which will
immediately resolve the request when fired.
- Cancel the timeout when requests are completed.
Add an optional argument to $q.defer to provide a canceling function.
This exposes a promise.cancel method that can be used to call the
canceling function and reject the promise (and all derived promises).
See existing implementations in Dojo Toolkit and Promised-IO library
for reference.
Implement the canceler option of `$q.defer` to allow interrupting
requests.

Closes angular#1159
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Cancel $http request
1 participant