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.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index 006f3d37..055f0890 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -387,7 +387,9 @@ angular.module('ngResource', ['ng']).
val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
if (angular.isDefined(val) && val !== null) {
encodedVal = encodeUriSegment(val);
- url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), encodedVal + "$1");
+ url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
+ return encodedVal + p1;
+ });
} else {
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
leadingSlashes, tail) {