2
votes

I'm trying to render multiple .hbs snippets into their respective outlets. However, the following renderTemplate does not work:

renderTemplate: function() {
     // default behavior, renders the home template
     this.render(); 
      this.render('hero', {    // render the `hero` template
       outlet: 'hero'  // using the outlet named `hero`
     });
   }, 

The template file in question looks like this:

{{outlet 'hero'}}
{{outlet}}

This actually renders the default template (this is the index route) twice: once in the hero outlet, and once in the regular outlet.

This seemed to work in ember1.7, even if the hero outlet was included in the application.hbs template. Not quite so with ember2.3.

How would I make this work?

1
^ I copied and pasted your code (in the appropriate places), and it seems to work now. I'm not sure exactly what I did wrong in the first place, but now it's working. Perhaps it was some sort of build issue I caused.Darshan

1 Answers

4
votes

With Ember 2.0 there is a lot of changes. I think this, and this are the most relevant in your case. If I am not mistaken, the Ember 2.x way is go for components now.