/**
- * @license AngularJS v1.4.10
+ * @license AngularJS v1.4.8
* (c) 2010-2015 Google, Inc. http://angularjs.org
* License: MIT
*/
* can escape it with `/\.`.
*
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
- * `actions` methods. If a parameter value is a function, it will be executed every time
+ * `actions` methods. If any of the parameter value is a function, it will be executed every time
* when a param value needs to be obtained for a request (unless the param was overridden).
*
* Each key value in the parameter object is first bound to url template if present and then any
* 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.<br />
- * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are
- * **not** supported in $resource, because the same value would be used for multiple requests.
- * If you need support for cancellable $resource actions, you should upgrade to version 1.5 or
- * higher.
+ * - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
+ * should abort the request when resolved.
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
* XHR object. See
* [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
* rendering until the resource(s) are loaded.
*
- * On failure, the promise is rejected with the {@link ng.$http http response} object, without
+ * On failure, the promise is resolved with the {@link ng.$http http response} object, without
* the `resource` property.
*
* If an interceptor object was provided, the promise will instead be resolved with the value
}
};
- this.$get = ['$http', '$log', '$q', function($http, $log, $q) {
+ this.$get = ['$http', '$q', function($http, $q) {
var noop = angular.noop,
forEach = angular.forEach,
case 'interceptor':
break;
case 'timeout':
- if (value && !angular.isNumber(value)) {
- $log.debug('ngResource:\n' +
- ' Only numeric values are allowed as `timeout`.\n' +
- ' Promises are not supported in $resource, because the same value would ' +
- 'be used for multiple requests.\n' +
- ' If you need support for cancellable $resource actions, you should ' +
- 'upgrade to version 1.5 or higher.');
- }
+ httpConfig[key] = value;
break;
}
});