2

I have a template that might render one of many different components. In the controller, I define which component is currently active, and then want to render it with something like:

{{render-component activeComponent}}

Unfortunately, the render-component part of things doesn't work. I followed the example I found here, but it's throwing the error: undefined is not a function.

In the example I linked to, they're passing in a second parameter like {{renderComponent widget.componentClass widget=widget}}, and perhaps since I'm not doing the same, that's why I'm getting this error? I tried passing this:

{{render-component activeComponent this}}

But I get the same error. Any tips? Unfortunately, I can't find any documentation on Handlebars's resolveHelper, which seems to be at the heart of the issue.

Community
  • 1
  • 1
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
  • The `renderComponent` helper in the question linked works but partially: it is not bound to the component name (so the helper does not re-render the component when its name changes), as you can [see in the JSBin](http://emberjs.jsbin.com/yawoyefohiku/1/edit?html,js,output). Unfortunately, [bound helpers does not support insertions of child views at this time](http://emberjs.com/api/classes/Ember.Handlebars.html#toc_use-with-blocks-not-supported) – louiscoquio Aug 13 '14 at 17:01
  • That's too bad. Thanks for the tip, though. – nullnullnull Aug 13 '14 at 20:13

0 Answers0