question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
atscottcommented, May 24, 2021

Closing as this appears to have been resolved by #37980. The documentation now has // from /view1?page=1 to/view2?page=1&otherKey=2

0reactions
angular-automatic-lock-bot[bot]commented, Jun 24, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found