Ember-1.0 Rendering into the same outlet no longer overrides the previously displayed content but appends to it?


#1

So upon updating to the latest ember version I noticed that renderTemplate hooks from multiple child routes, rendering into the same outlet of a parent template no longer replace one another when the route is visited, but rather append to each other in the template. So visiting child 1 route via transitionTo() and then child 2 of parent route would initially render child1 template, and then child2 template underneath child1 template and so on.

Is this a bug or a change that we need to adjust our code for? I haven’t been able to think of a solution to this other than possibly calling re-render on the parent route itself.


#2

Hey,

Something has really changed with the way Ember perform the transitions between pages in 1.0.0-RC8, and this happened to me too, but apparently the problem was that I forgot to close one of the tags in the first visited template, ensure all tags are closed properly in both templates and retry,

Asaf.


#3

Turns out you are right on both accounts. Something has indeed changed in the way ember transitions and renders, I wish there was documentation for this. That being said i fixed my problem by finding the missing tag but I did also learn something new about the new ember.

**Before:**You could have a set up like this:

Parent Template

div class=span10>
{{outlet content}}
div>

div class=span2>
random static html
div>


**Child Template:**

div class=span7>
random html
div>

div class=span5>
random static html
div>

and ember was smart enough to nest the total of span 12 from the child template rendered into the outlet within the span 10 and refactor the ratios. Now however you have to personally ensure that the spans in the child template add up to the total span allotted in the div holding the outlet, in this case 10.

I really wish for this functionality to return :frowning:

Also how do i put in code without this chat trying to render the html? lol I had to ommitt the < in the div tags haha.


#4

I don’t have a git-hub account so maybe somebody could list this as a bug up there for me or a broken piece of functionality? :smiley: