2
votes

I would like to render the block of a ContainerView within one of the child view's template, so if I have a view such:

MainView = Ember.ContainerView.extend({
  childViews: ['child'],
  child: Ember.View.extend({
    template: Ember.Handlebars.compile('{{view.parentView.template}}')
  }),
});

Ember.Handlebars.helper('main-view', MainView);

Assuming in template I have something like:

{{#main-view}}
    SOME CONTENT.
{{/main-view}}

This wont work because view.parentview.template references a function that Ember set as the template, so, is there a way to make the childView's template refer to the parent's template?

Thanks!

1

1 Answers

1
votes

ContainerView doesn't have neither template nor layout :/. It only has the properties to set tagName classNames, etc and then it will render the childViews(buffer) inside it.

A while ago, I was pointing a similar issue: https://github.com/emberjs/ember.js/issues/3334

Let's hope someone add support to wrapping(layout) for ContainerView, that way you could solve your problem too!