-
Notifications
You must be signed in to change notification settings - Fork 27k
feat(router): Support wildcard params with segments trailing #64737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
this adds support for both leading and trailing segments before/after wildcard route. Exposig the segments in a new _splat param would require a breaking change to the return value of the matchers. fixes angular#60821
|
This PR was merged into the repository. The changes were merged into the following branches:
|
| { | ||
| path: '**/b', | ||
| component: ComponentB, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @atscott . Thank you for supporting more sophisticated wildcard route paths, so that we don't need to build custom UrlMatchers in such cases (that are tricky to write and test).
FYI In our Spartacus library in the past we've built custom "suffix url matchers", e.g. to match a pattern like **/p/:productCode.
So let me ask a question for our usecase: Is this PR supporting also dynamic params (:param) as the URL segments? I'm asking, as I'm having problem to find unit tests for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this only supports static suffixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. I hadn't specifically intended to support the path params after the wildcard, but it does work since the matchParts function is shared for all the matching and includes the logic for parameters. I'll add some tests for this case.
…dcard This adds additional tests following the initial implementation in angular#64737 that cover the use-case of path parameters before and after the wildcard segment.
…dcard This adds additional tests following the initial implementation in #64737 that cover the use-case of path parameters before and after the wildcard segment.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
this adds support for both leading and trailing segments before/after wildcard route. Exposig the segments in a new _splat param would require a breaking change to the return value of the matchers.
fixes #60821