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
link-to helper will run linked route controller init hook when rendered #15973
Comments
I am running into the same issue with ember-cli 2.16 |
I believe this is because you need to initialize the controller to check for default values for query params, in order to know what to display. Trying to confirm this. |
Running into this issue as well. Seems like this is an issue with 3.0+. Just started noticing it when I upgraded from 2.x |
As @locks mentioned, the target controller is instantiated so that we can properly handle query params. This isn't a bug per-se, but a limitation of the current |
With Ember 2.13 and before the init hook of the target controller was not executed. It only started with Ember 2.14 if that helps. If this is indeed expected behavior now it should be documented. |
@konradjurk Created this Twiddle that demonstrates this: Go to parent route and change between versions 2.12 and 2.18 for example to see the difference in functionality. |
Closing this issue due to inactivity and due to the fact that the controller being instantiated is a side-effect of needing to check the default values of query params. |
When you put link-to helper in your code, it will run linked routes init-hook in controller when rendering helper.
{{#link-to "page"}}Link to other route{{/link-to}}
will run init-hook in "page"-routes controllerI have provided a simple example project where you can see the error
https://github.com/moveniumville/ember_link-to_init
Not working in 2.16 and 2.17 at least
The text was updated successfully, but these errors were encountered: