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.

Router not working with multiple query parameters with the same name.

See original GitHub issue

I’m submitting a … (check one with “x”)

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Currently when going to a url with multiple query parameters with the same key the DefaultUrlSerializer is removing all but the last one from the url.

/something/route?room=a1&room=a4&room=a6

This link will be rewritten to:

/something/route?room=a6

Expected/desired behavior

The url should remain the same and keep all parameters.

Please tell us about your environment:

  • Angular version: 2.0.0-rc.6
  • Browser: all
  • Language: Typescript

This pull request fixes the issue but it’s my first one - https://github.com/angular/angular/pull/11373

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
spacebeerscommented, Sep 8, 2016

I would expect an array back.

5reactions
TeeeJaycommented, Sep 16, 2016

I would at least expect some way of handling the use case of when we need to send an array as parameter (e.g. in faceted search), instead of “creating a magic string” and having to deal with parsing the it yourself. +1 for the bug report and pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get multiple parameters with same name from a URL ...
I don't see the need to manually insert the query parameters to the URL. You could leverage the queryParams options of the Angular...
Read more >
Query Parameters - Routing - Ember Guides
Query parameters are optional key-value pairs that appear to the right of the ? in a URL. For example, the following URL has...
Read more >
Getting Query Strings (Search Params) in React Router
React Router v6 provides a useSearchParams() hook that we can use to read those query string search params that we need from the...
Read more >
How to Get Parameter Value from Query String in React
To obtain parameter value from query string without react-router in reactjs app. 4. Multiple Query parameters; Conclusion. Query strings are ...
Read more >
Sure, multiple query params with the same name are...
Sure, multiple query params with the same name are allowed, and Auto-Fill acts accordingly (let's see what that means!) · Multiple occurrences ...
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