@@ -114,8 +114,9 @@ function shallowClearAndCopy(src, dst) {
114
114
* can escape it with `/\.`.
115
115
*
116
116
* @param {Object= } paramDefaults Default values for `url` parameters. These can be overridden in
117
- * `actions` methods. If a parameter value is a function, it will be executed every time
118
- * when a param value needs to be obtained for a request (unless the param was overridden).
117
+ * `actions` methods. If a parameter value is a function, it will be called every time
118
+ * a param value needs to be obtained for a request (unless the param was overridden). The function
119
+ * will be passed the current data value as a argument.
119
120
*
120
121
* Each key value in the parameter object is first bound to url template if present and then any
121
122
* excess keys are appended to the url search query after the `?`.
@@ -146,8 +147,9 @@ function shallowClearAndCopy(src, dst) {
146
147
* - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
147
148
* `DELETE`, `JSONP`, etc).
148
149
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
149
- * the parameter value is a function, it will be executed every time when a param value needs to
150
- * be obtained for a request (unless the param was overridden).
150
+ * the parameter value is a function, it will be called every time when a param value needs to
151
+ * be obtained for a request (unless the param was overridden). The function will be passed the
152
+ * current data value as a argument.
151
153
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
152
154
* like for the resource-level urls.
153
155
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
@@ -644,7 +646,7 @@ angular.module('ngResource', ['ng']).
644
646
var ids = { } ;
645
647
actionParams = extend ( { } , paramDefaults , actionParams ) ;
646
648
forEach ( actionParams , function ( value , key ) {
647
- if ( isFunction ( value ) ) { value = value ( ) ; }
649
+ if ( isFunction ( value ) ) { value = value ( data ) ; }
648
650
ids [ key ] = value && value . charAt && value . charAt ( 0 ) === '@' ?
649
651
lookupDottedPath ( data , value . substr ( 1 ) ) : value ;
650
652
} ) ;
0 commit comments