From 8ecfef7d9da905d8572441cebff58f8b6482834e Mon Sep 17 00:00:00 2001 From: andresmoschini Date: Mon, 16 Jul 2012 13:17:02 -0300 Subject: [PATCH] Add support to Catch-All routes It allows to accept routes like `edit/color/:color/largecode/*largecode` to match with something like this `http://appdomain.com/edit/color/brown/largecode/code/with/slashs` **I really need it because my app ids contains slashs.** --- src/ng/route.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ng/route.js b/src/ng/route.js index 298732aac0b0..022cda108d9e 100644 --- a/src/ng/route.js +++ b/src/ng/route.js @@ -326,6 +326,12 @@ function $RouteProvider(){ if (regex.match(paramRegExp)) { regex = regex.replace(paramRegExp, "([^\\/]*)$1"); params.push(param); + } else { + var specialParamRegExp = new RegExp("\\*" + param + "([\\W])"); + if (regex.match(specialParamRegExp)) { + regex = regex.replace(specialParamRegExp, "(.*)$1"); + params.push(param); + } } } });