mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
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
This commit is contained in:
committed by
Igor Minar
parent
b21f4a376d
commit
94e1c0391c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user