Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8ecfef7

Browse files
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.**
1 parent a8b0400 commit 8ecfef7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ng/route.js

+6
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ function $RouteProvider(){
326326
if (regex.match(paramRegExp)) {
327327
regex = regex.replace(paramRegExp, "([^\\/]*)$1");
328328
params.push(param);
329+
} else {
330+
var specialParamRegExp = new RegExp("\\*" + param + "([\\W])");
331+
if (regex.match(specialParamRegExp)) {
332+
regex = regex.replace(specialParamRegExp, "(.*)$1");
333+
params.push(param);
334+
}
329335
}
330336
}
331337
});

0 commit comments

Comments
 (0)