feat(routeParams): Add support to catch-all parameters in routes#1559
feat(routeParams): Add support to catch-all parameters in routes#1559lrlopez wants to merge 3 commits intoangular:masterfrom
Conversation
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.**
This allows routeProvider to accept parameters that matches substrings even when they contain slashes if they are prefixed with an asterisk instead of a colon. For example, routes like edit/color/:color/largecode/*largecode will match with something like this http://appdomain.com/edit/color/brown/largecode/code/with/slashs.
|
This PR is related to #1147 which was created by @andresmoschini and assigned to @mhevery. I've just added some tests and documentation. I'd like not to have merged 'master' branch to better isolate the changes, but I needed Testacular support for the tests. Also, I've already signed the CLA. I hope everything is ok with this PR. |
|
@lrlopez I think that something went wrong with git operations, no? Especially the 09b0825 looks bad. Could you try to prepare a PR with only one, single commit, having all the changes that needs to be done for this PR? This one single commit should have both @andresmoschini changes and your changes. With 3 commits like this it is really hard to see what is changing in this PR. |
|
Sure. I will prepare a new PR ASAP and close this one... |
|
Closed because PR #1560 suppresses this one. |
This allows
routeProviderto accept parameters that matches substrings even when they contain slashes if they are prefixed with an asterisk instead of a colon.This PR introduces a new syntax for route params, so we would have:
:paramfor a single param*paramfor catch-all paramsFor example, routes like
edit/color/:color/largecode/*largecodewill match with something like thishttp://appdomain.com/edit/color/brown/largecode/code/with/slashsIt also matches catch-all routes in the middle of the path.