aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngResource
diff options
context:
space:
mode:
Diffstat (limited to 'src/ngResource')
-rw-r--r--src/ngResource/resource.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index d11a4d60..e2499864 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -439,7 +439,7 @@ angular.module('ngResource', ['ng']).
}
/* jshint +W086 */ /* (purposefully fall through case statements) */
- var isInstanceCall = data instanceof Resource;
+ var isInstanceCall = this instanceof Resource;
var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
var httpConfig = {};
var responseInterceptor = action.interceptor && action.interceptor.response ||
@@ -522,7 +522,7 @@ angular.module('ngResource', ['ng']).
if (isFunction(params)) {
error = success; success = params; params = {};
}
- var result = Resource[name](params, this, success, error);
+ var result = Resource[name].call(this, params, this, success, error);
return result.$promise || result;
};
});