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

Commit 1c232a1

Browse files
committed
fix(ngResource): canceling XHR request using promise - recator
1 parent 2955bbf commit 1c232a1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/ngResource/resource.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,17 @@ angular.module('ngResource', ['ng']).
568568
undefined;
569569

570570
forEach(action, function(value, key) {
571-
if (key != 'params' && key != 'isArray' && key != 'interceptor' && key != 'timeout') {
572-
httpConfig[key] = copy(value);
573-
} else if (key == 'timeout') {
574-
httpConfig[key] = value;
571+
switch (key) {
572+
default:
573+
httpConfig[key] = copy(value);
574+
break;
575+
case 'params':
576+
case 'isArray':
577+
case 'interceptor':
578+
break;
579+
case 'timeout':
580+
httpConfig[key] = value;
581+
break;
575582
}
576583
});
577584

0 commit comments

Comments
 (0)