diff options
| author | David Bennett | 2013-04-27 11:22:03 -0400 | 
|---|---|---|
| committer | Igor Minar | 2013-05-20 14:15:04 -0700 | 
| commit | 9f4f5937112655a9881d3281da8e72035bc8b180 (patch) | |
| tree | f6c9b19448ea5ddde11198b0e6d7a516e0b83d7b /src/ngResource | |
| parent | 27a8824b50aa78e9a082b4377ca09250382a8655 (diff) | |
| download | angular.js-9f4f5937112655a9881d3281da8e72035bc8b180.tar.bz2 | |
feat($http): add support for aborting via timeout promises
If the timeout argument is a promise, abort the request when it is resolved.
Implemented by adding support to $httpBackend service and $httpBackend mock
service.
This api can also be used to explicitly abort requests while keeping the
communication between the deffered and promise unidirectional.
Closes #1159
Diffstat (limited to 'src/ngResource')
| -rw-r--r-- | src/ngResource/resource.js | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index c165ffab..59ac3b3a 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -85,7 +85,8 @@   *     GET request, otherwise if a cache instance built with   *     {@link ng.$cacheFactory $cacheFactory}, this cache will be used for   *     caching. - *   - **`timeout`** – `{number}` – timeout in milliseconds. + *   - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that + *     should abort the request when resolved.   *   - **`withCredentials`** - `{boolean}` - whether to to set the `withCredentials` flag on the   *     XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5   *     requests with credentials} for more information. | 
