diff options
| author | Adrian Gheorghe | 2012-09-23 01:53:08 +0200 | 
|---|---|---|
| committer | Igor Minar | 2012-11-24 21:27:24 +0100 | 
| commit | 94e1c0391c351b6f691fad8abed2828fa20548b2 (patch) | |
| tree | 46281603e4e3204cec26c085826e2abc30273bbd /src/ngResource/resource.js | |
| parent | b21f4a376d2ead526bcde47f0bb1d5580e1c3efa (diff) | |
| download | angular.js-94e1c0391c351b6f691fad8abed2828fa20548b2.tar.bz2 | |
fix($resource): prevent default params to be shared between actions
Having a $resource defined as:
var R = $resource('/Path', {}, {
  get: {method: 'GET', params: {objId: '1'}},
  perform: {method: 'GET'}
});
was causing both actions to call the same URI (if called in this order):
R.get({}); // => /Path?objId=1
R.perform({}); // => /Path?objId=1
Diffstat (limited to 'src/ngResource/resource.js')
| -rw-r--r-- | src/ngResource/resource.js | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index ab5dc52a..db86eb41 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -314,8 +314,8 @@ angular.module('ngResource', ['ng']).        function extractParams(data, actionParams){          var ids = {}; -        paramDefaults = extend(paramDefaults, actionParams); -        forEach(paramDefaults || {}, function(value, key){ +        actionParams = extend({}, paramDefaults, actionParams); +        forEach(actionParams, function(value, key){            ids[key] = value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value;          });          return ids; | 
