refactor($resource): use route.defaults (already merged provider.defaults + options)

Closes #15160
This commit is contained in:
Georgios Kalpakas
2016-09-19 21:56:41 +03:00
parent bf61c1471d
commit 8d4d3d527d
+2 -3
View File
@@ -642,9 +642,8 @@ angular.module('ngResource', ['ng']).
forEach(actions, function(action, name) {
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
var numericTimeout = action.timeout;
var cancellable = isDefined(action.cancellable) ? action.cancellable :
(options && isDefined(options.cancellable)) ? options.cancellable :
provider.defaults.cancellable;
var cancellable = isDefined(action.cancellable) ?
action.cancellable : route.defaults.cancellable;
if (numericTimeout && !isNumber(numericTimeout)) {
$log.debug('ngResource:\n' +