aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngResource/resource.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ngResource/resource.js')
-rw-r--r--src/ngResource/resource.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index 92cbcd16..003b41f1 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -473,6 +473,11 @@ angular.module('ngResource', ['ng']).
promise = value.$promise;
if (data) {
+ if ( angular.isArray(data) != !!action.isArray ) {
+ throw ngResourceMinErr('badcfg', 'Error in resource configuration. Expected response' +
+ ' to contain an {0} but got an {1}',
+ action.isArray?'array':'object', angular.isArray(data)?'array':'object');
+ }
if (action.isArray) {
value.length = 0;
forEach(data, function(item) {