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

{{render}} helper no longer able to bubble actions without legacy controller addon. #13182

Closed
rwjblue opened this issue Mar 25, 2016 · 1 comment

Comments

@rwjblue
Copy link
Member

rwjblue commented Mar 25, 2016

Given the following example:

{{! index template}}
{{render 'some-name' someModel}}
<p>{{this}} - {{this.target}} - {{this.parentController}}</p>

<button {{action 'thingInApplicationRoute'}}>
  Should hit route!
</button>

In Ember 2.0 and 2.1, that action would bubble properly to the router (and then on to the application route). In Ember 2.2 and above this bubbling behavior is no longer present, unless the ember-legacy-controller addon is in use.

The root cause is that we no longer create the controller template local unless that addon is present (this was done in #12289 which landed in 2.2), however the {{render helper still grabs the controller local to specify target for the newly created controller instance (the controller local is looked up here and passed as the target here and here).

2.1 demo
2.2 demo
2.3 demo
2.4 demo

Working 2.4 demo with the legacy controller flag enabled.


The fix is to fallback to the previously looked up router instance if the parentController variable is undefined. PR will be incoming shortly....

@rwjblue
Copy link
Member Author

rwjblue commented Mar 25, 2016

Updated with a bunch of demos.

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

1 participant