Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember sub-controllers

I was wondering how one might solve the following problem in Ember.js: I'm implementing a kind of a dashboard UI, filled with all different kinds of chart widgets. So, I have a list of ui-widget in my WidgetsController which I want to render on the screen.

The problem is each widget has a different template and should probably have a different controller, etc.

So I guess my question is how do you iterate over a list and render each item with a different controller/template.

Or if you can't, how would you deal with this sort of problem - rendering a list of different kinds of things?

Thanks!

like image 316
Ofri Avatar asked Jun 10 '26 03:06

Ofri


1 Answers

You should check out ember ContainerView.

You do not need Handlebars to invoke the creation of your Components and add them to your View. Take a look at my example here:

http://emberjs.jsbin.com/pisay/1/edit

like image 102
Oliver Avatar answered Jun 11 '26 16:06

Oliver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!