aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ng/route.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ng/route.js b/src/ng/route.js
index e2a9c633..361b8ac3 100644
--- a/src/ng/route.js
+++ b/src/ng/route.js
@@ -321,12 +321,12 @@ function $RouteProvider(){
var regex = '^' + when.replace(/([\.\\\(\)\^\$])/g, "\\$1") + '$',
params = [],
dst = {};
- forEach(when.split(/\W/), function(param) {
- if (param) {
- var paramRegExp = new RegExp(":" + param + "([\\W])");
+ forEach(when.split(/[^\w:]/), function(param) {
+ if (param && param.charAt(0) === ':') {
+ var paramRegExp = new RegExp(param + "([\\W])");
if (regex.match(paramRegExp)) {
regex = regex.replace(paramRegExp, "([^\\/]*)$1");
- params.push(param);
+ params.push(param.substr(1));
}
}
});