@@ -114,8 +114,9 @@ function shallowClearAndCopy(src, dst) {
114114 * can escape it with `/\.`.
115115 *
116116 * @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.
119120 *
120121 * Each key value in the parameter object is first bound to url template if present and then any
121122 * excess keys are appended to the url search query after the `?`.
@@ -146,8 +147,9 @@ function shallowClearAndCopy(src, dst) {
146147 * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
147148 * `DELETE`, `JSONP`, etc).
148149 * - **`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.
151153 * - **`url`** – {string} – action specific `url` override. The url templating is supported just
152154 * like for the resource-level urls.
153155 * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
@@ -644,7 +646,7 @@ angular.module('ngResource', ['ng']).
644646 var ids = { } ;
645647 actionParams = extend ( { } , paramDefaults , actionParams ) ;
646648 forEach ( actionParams , function ( value , key ) {
647- if ( isFunction ( value ) ) { value = value ( ) ; }
649+ if ( isFunction ( value ) ) { value = value ( data ) ; }
648650 ids [ key ] = value && value . charAt && value . charAt ( 0 ) === '@' ?
649651 lookupDottedPath ( data , value . substr ( 1 ) ) : value ;
650652 } ) ;
0 commit comments