aboutsummaryrefslogtreecommitdiffstats
path: root/src/Resource.js
diff options
context:
space:
mode:
authorKarl Seamon2011-08-18 15:07:04 -0400
committerKarl Seamon2011-08-18 15:07:04 -0400
commit6114c8f504e99fecb0d62cce4beb3a8f39f301ec (patch)
tree6e8567b0a64ed3f2e1569d184617985042744760 /src/Resource.js
parentb99b0a80723ad3a9b43e9ef36869f521eaec19ec (diff)
downloadangular.js-6114c8f504e99fecb0d62cce4beb3a8f39f301ec.tar.bz2
fix($resource): properly call error callback when resource is called with two arguments
Diffstat (limited to 'src/Resource.js')
-rw-r--r--src/Resource.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Resource.js b/src/Resource.js
index 3c149d8b..74d952ed 100644
--- a/src/Resource.js
+++ b/src/Resource.js
@@ -76,9 +76,16 @@ ResourceFactory.prototype = {
case 4:
error = a4;
success = a3;
+ //fallthrough
case 3:
case 2:
if (isFunction(a2)) {
+ if (isFunction(a1)) {
+ success = a1;
+ error = a2;
+ break;
+ }
+
success = a2;
error = a3;
//fallthrough