queryParamsHandling: 'merge' behavior not matching documentation
See original GitHub issue🐞 bug report
Description
The documentation for the queryParamsHandling
prop doesn’t seem to match the behavior when using queryParamsHandling: 'merge'
inside of a router.navigate(...)
call.
Instead of appending an additional instance of a particular queryParam, the navigation replaces the existing param, leaving the URL as /someRoute?page=2
instead of /someRoute?page=1&page=2
as the documentation seems to imply.
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-dqgg24
🌍 Your Environment
Angular Version:
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.1
@angular-devkit/build-optimizer 0.800.1
@angular-devkit/build-webpack 0.800.1
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cli 8.0.1
@ngtools/webpack 8.0.1
@schematics/angular 8.0.1
@schematics/update 0.800.1
rxjs 6.5.2
typescript 3.4.5
webpack 4.29.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (7 by maintainers)
Top Results From Across the Web
QueryParamsHandling - Angular
How to handle query parameters in a router link. One of: "merge" : Merge new parameters with current parameters. "preserve" : Preserve current...
Read more >How to use queryParamsHandling In Angular | Akashminds
Merge : This is the default option and will simply merge the new query parameters with any existing query parameters that are already...
Read more >Change route params without reloading in Angular 2
Use attribute queryParamsHandling: 'merge' while changing the url. this.router.
Read more >Router tutorial: tour of heroes - Angular
The queryParamsHandling feature also provides a merge option, which preserves and combines the current query parameters with any provided query parameters when ...
Read more >@angular/router@15.0.4 - jsDocs.io
Documentation for npm package @angular/router@15.0.4 - jsDocs.io. ... The resulting match information or null if the route should not match.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as this appears to have been resolved by #37980. The documentation now has
// from /view1?page=1 to/view2?page=1&otherKey=2
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.