fix(router): fix matrix params check to handle 'special' objects
This commit is contained in:
@ -35,11 +35,16 @@ export function createUrlTree(
|
||||
}
|
||||
|
||||
function validateCommands(n: NormalizedNavigationCommands): void {
|
||||
if (n.isAbsolute && n.commands.length > 0 && (typeof n.commands[0] === 'object')) {
|
||||
if (n.isAbsolute && n.commands.length > 0 && isMatrixParams(n.commands[0])) {
|
||||
throw new Error('Root segment cannot have matrix parameters');
|
||||
}
|
||||
}
|
||||
|
||||
function isMatrixParams(command: any): boolean {
|
||||
return typeof command === 'object' && command.outlets === undefined &&
|
||||
command.segmentPath === undefined;
|
||||
}
|
||||
|
||||
function tree(
|
||||
oldSegmentGroup: UrlSegmentGroup, newSegmentGroup: UrlSegmentGroup, urlTree: UrlTree,
|
||||
queryParams: Params, fragment: string): UrlTree {
|
||||
|
Reference in New Issue
Block a user