-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
fix(router): do not require the creation of empty-path routes when no… #12772
Conversation
@@ -655,13 +675,13 @@ describe('Integration', () => { | |||
expect(cmp.activations.length).toEqual(1); | |||
expect(cmp.activations[0] instanceof BlankCmp).toBe(true); | |||
|
|||
router.navigateByUrl('/simple'); | |||
router.navigateByUrl('/simple').catch(e => console.log(e)); |
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.
debug ?
const parts = path.split('/'); | ||
const positionalParamSegments: {[k: string]: UrlSegment} = {}; | ||
const consumedSegments: UrlSegment[] = []; | ||
const matcher = route.matcher ? route.matcher : defaultUrlMatcher; |
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.
route.matcher || defaultUrlMatcher
* @experimental | ||
*/ | ||
export type UrlMatchResult = { | ||
consumed: UrlSegment[], posParams?: {[name: string]: UrlSegment}; |
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.
nit: mixed ,/;
* @experimental | ||
*/ | ||
export type UrlMatchResult = { | ||
consumed: UrlSegment[], posParams?: {[name: string]: UrlSegment}; |
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.
consumedSegments
to be consistent with previous file ?
* | ||
* @description | ||
* | ||
* A custom URL matcher can be provided when a combination of `path` and `pathMatch` isn't |
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.
nit: formatting
* | ||
* ``` | ||
* function htmlFiles(url: UrlSegment[]) { | ||
* return url.length === 1 && url[0].path.endsWith('.html') ? ({consuemd: url}) : null; |
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.
typo consumed
const parts = path.split('/'); | ||
const posParameters: {[key: string]: any} = {}; | ||
const consumedSegments: UrlSegment[] = []; | ||
const matcher = route.matcher ? route.matcher : defaultUrlMatcher; |
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.
||
028e889
to
cf56501
Compare
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. |
Two Changes
Relax Matching
Previously having this configuration
the following url would not match '/parent'. You would have to create a bogus empty-path route, so the configuration looks like this:
Now it is no longer required.
Custom Matching
We are adding support for doing custom url matching.