emberjs / emberjs/ember.js

RouterService urlFor queryParams not serialized if is array of objects

Open
#18,082 2 comments 0 reactions 0 assignees View on GitHub
Needs Bug Verification Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

Imagine filters is an array of objects:

`[
{
key: "foo",
value: bar"
},
{
key: "qux",
value: bar"
}
]`

Link to will generate a valid JSON.stringified URI.
`
{{#link-to "index" (query-params filters=filters)}}hallo{{/link-to}}`
[/?filters=%5B%7B"key"%3A"foor"%2C"operator"%3A"%3D%3D"%2C"value"%3A"bar"%7D%2C%7B"key"%3A"qux"%2C"operator"%3A"%3D%3D"%2C"value"%3A"bar"%7D%5D](url)

The RouterService urlFor function, will last us with an [object Object] URI
`this.urlFor('index', {queryParams: {filters: this.Filters}})`
[/?filters[]=%5Bobject%20Object%5D&filters[]=%5Bobject%20Object%5D](url)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.