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

Router Service: Default Query Param Values are Serialized to the URL #16973

Closed
iezer opened this issue Sep 13, 2018 · 5 comments
Closed

Router Service: Default Query Param Values are Serialized to the URL #16973

iezer opened this issue Sep 13, 2018 · 5 comments

Comments

@iezer
Copy link
Contributor

iezer commented Sep 13, 2018

I have a route with a default query param specified in the controller. If I transition to this route using a link-to, a controller action, or a route action, the default query param is not serialized to the URL. However, if I transition by using the router service, by calling router.transitionTo(...), the default value does appear in the URL.

Here's a reproduction twiddle.

Possibly related to #16594, although I don't get any errors in the console.

@Exelord
Copy link
Contributor

Exelord commented Sep 14, 2018

Confirmed!

@iezer
Copy link
Contributor Author

iezer commented Sep 14, 2018

Turns out this is deliberate behavior described in the Router Service RFC. It's implemented here as part of this commit and there's even a test.

This behavior is not documented anywhere other than the RFC so I'll open a PR with some documentation.

@iezer
Copy link
Contributor Author

iezer commented Sep 14, 2018

@rwjblue the Router Service RFC describes adding a symbol Ember.DEFAULT_VALUE exposed as import { DEFAULT_VALUE } from 'ember-routing'; for hiding default query params when using the Router service, but it seems like this was never implemented. Is it still part of the plan? If so I'd be happy to work on it.

@iezer
Copy link
Contributor Author

iezer commented Sep 14, 2018

Adding @miguelcobain and @chadhietala since you've worked on the RFC and Router service and may have some comments.

iezer added a commit to iezer/ember.js that referenced this issue Sep 21, 2018
@rwjblue
Copy link
Member

rwjblue commented Dec 10, 2018

Docs were fixed in
#16977, considering this closed...

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

No branches or pull requests

3 participants