Router not working with multiple query parameters with the same name.
See original GitHub issueI’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:
- Created 7 years ago
- Comments:12 (5 by maintainers)
Top 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 >
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 Free
Top 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
I would expect an array back.
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.