Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request param from the url query string return string instead of array for param with multiple value #22

Closed
quang-tuan opened this issue Jan 13, 2017 · 2 comments
Labels
Milestone

Comments

@quang-tuan
Copy link

When passing an array as search query through the param using the [uiPrams] everything work as expected where the param is returned as array of string. However, passing the search query through the url such as ?param=test1&param=test2 the app is returning a string (test2) instead of array of string.

Plunker example has 2 link where one is using the uiSref, the other one is using the href
https://plnkr.co/edit/HNeb0egtVUFUt7eNPpfZ?p=preview

I believe the issue is caused by this line in location.ts

loc.search = <any> (() => {
   let queryString = splitOnHash(splitOnQuestionMark(locSt.path())[1])[0];
   return queryString.split("&").map(kv => splitOnEquals(kv)).reduce(applyPairs, {});
 });

The applyPairs function return key, value assumed that keys are unique.

@christopherthielen christopherthielen added this to the 1.0.0-beta.6 milestone Jan 21, 2017
@christopherthielen
Copy link
Member

This will be fixed in beta.4: https://plnkr.co/edit/hZ2Lehs2IOxw1qdufPF4?p=preview

We're now using a wrapper around the "vanilla" location api from ui-router-core which properly manages arrays

@christopherthielen
Copy link
Member

fixed in beta.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants