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

Respect parent route query params #62

Open
Panman82 opened this issue Oct 17, 2016 · 6 comments
Open

Respect parent route query params #62

Panman82 opened this issue Oct 17, 2016 · 6 comments

Comments

@Panman82
Copy link

In my app I have a query param at the application level. Most of the time it'll never make it's way into the URL because the default value is not changed. However, when it is, it seems like any {{href-to}} URL's don't know about that, probably because it isn't passed in as (query-params). The issue would be that child routes don't really have direct access to the current value to pass in. Is there a way for this helper to know about those and add them to the URL automatically?

@Panman82
Copy link
Author

@cibernox Would PR #47 resolve this issue?

@cibernox
Copy link
Contributor

Yes, that was the idea, but I have to admit that I hit a dead end with that. The logic around query params was quite messy. I should try to finish it, but I don't think I'll have time in the next days.

@homersimpsons
Copy link

@cibernox
Copy link
Contributor

@homersimpsons I didn't find a solution for the PR and i forgot about it. I'm not sure if with the new router service almost done in newer versions we should keep pursuing this as it will be an "official" href-to soon.

@homersimpsons
Copy link

@cibernox Okay, thank you for your answer :)

@MartinMalinda
Copy link

MartinMalinda commented Aug 19, 2017

It should be possible to achieve this via ember-router-helpers.

{{#with (route-params 'parent.child') as |routeParams|}}
   <a href={{routeParams.url}}
    class={{if routeParams.isActive "active" "inactive"}}
    {{action routeParams.transitionTo}}>Blah</a>
{{/with}}

I didn't test it directly, but I tried it in my own version of those. The core difference is that the transition is not handled via URL handling but by using route params directly.

DingoEatingFuzz added a commit to hashicorp/nomad that referenced this issue Oct 24, 2017
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

4 participants