-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix for using {{render}} with same template multiple times #2312
Fix for using {{render}} with same template multiple times #2312
Conversation
This is a duplicate of #2274 |
Thanks! Must have missed #2274. I think that a combination of those two would be optimal. The test should make a template with two different models, like in mine. And both the change you made and the one I made in |
I also added another test where the |
Can you rebase this against master? |
@wycats Done :) |
@@ -44,7 +44,9 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) { | |||
container = options.data.keywords.controller.container; | |||
router = container.lookup('router:main'); | |||
|
|||
Ember.assert("This view is already rendered", !router || !router._lookupActiveView(name)); | |||
if (!context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we want all conditionals to be part of the assert so that they can get stripped out for prod/min builds. This means changing the assert condition to context || !router || !router._lookupActiveView(name)
.
I think once the one small fix I suggested is made then we're good to go. |
@wagenet Makes sense :). I have fixed the assertion now. Thanks. |
Fix for using {{render}} with same template multiple times
Yehuda added support for using
{{render}}
with same template multiple times with different models in 47dfe5e. But when using it, Ember threw an assertion error,"This view is already rendered"
, for everything but the first{{render}}
call.This should be fixed now, and I added a test for it and adjusted the assertion error message.