@@ -192,7 +192,12 @@ function shallowClearAndCopy(src, dst) {
192
192
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
193
193
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
194
194
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
195
- * with `http response` object. See {@link ng.$http $http interceptors}.
195
+ * with `http response` object. See {@link ng.$http $http interceptors}. In addition, the
196
+ * resource instance or array object is accessible by the `resource` property of the
197
+ * `http response` object.
198
+ * Keep in mind that the associated promise will be resolved with the value returned by the
199
+ * response interceptor, if one is specified. The default response interceptor returns
200
+ * `response.resource` (i.e. the resource instance or array).
196
201
* - **`hasBody`** - `{boolean}` - allows to specify if a request body should be included or not.
197
202
* If not specified only POST, PUT and PATCH requests will have a body.
198
203
*
@@ -267,8 +272,7 @@ function shallowClearAndCopy(src, dst) {
267
272
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
268
273
* rendering until the resource(s) are loaded.
269
274
*
270
- * On failure, the promise is rejected with the {@link ng.$http http response} object, without
271
- * the `resource` property.
275
+ * On failure, the promise is rejected with the {@link ng.$http http response} object.
272
276
*
273
277
* If an interceptor object was provided, the promise will instead be resolved with the value
274
278
* returned by the interceptor.
@@ -776,6 +780,9 @@ angular.module('ngResource', ['ng']).
776
780
response . resource = value ;
777
781
778
782
return response ;
783
+ } , function ( response ) {
784
+ response . resource = value ;
785
+ return $q . reject ( response ) ;
779
786
} ) ;
780
787
781
788
promise = promise [ 'finally' ] ( function ( ) {
0 commit comments