fix(router): 'merge' queryParamHandling strategy should be able to remove query params (#19733)
Closes #18463, #17202 PR Close #19733
This commit is contained in:
@ -408,6 +408,9 @@ export class Router {
|
||||
} else {
|
||||
q = preserveQueryParams ? this.currentUrlTree.queryParams : queryParams || null;
|
||||
}
|
||||
if (q !== null) {
|
||||
q = this.removeEmptyProps(q);
|
||||
}
|
||||
return createUrlTree(a, this.currentUrlTree, commands, q !, f !);
|
||||
}
|
||||
|
||||
@ -463,9 +466,6 @@ export class Router {
|
||||
navigate(commands: any[], extras: NavigationExtras = {skipLocationChange: false}):
|
||||
Promise<boolean> {
|
||||
validateCommands(commands);
|
||||
if (typeof extras.queryParams === 'object' && extras.queryParams !== null) {
|
||||
extras.queryParams = this.removeEmptyProps(extras.queryParams);
|
||||
}
|
||||
return this.navigateByUrl(this.createUrlTree(commands, extras), extras);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user