I am having a lot of (painful) problems with nested objects in Ember. I think I might be tackling things the wrong way since I suspect it is a fairly standard thing to do.
Say I have an Object A that "has many" B, and each B "has many" C, etc (this architecture basically matches my relational DB schema).
I don't need nested routes for these, so I thought a natural way to render an object like A was to use partials. Something like:
Template for A:
...A stuff...
{{#each Bs}}
{{ partial "show_B" }}
{{/each}}
and so on.
The problem is I would like the child objects to have their own controllers. I know that there is the new itemController since RC1 (http://emberjs.com/blog/2013/02/15/ember-1-0-rc.html) which is useful, but somehow limited. Let's say that further down in the hierarchy, C objects each have a single D object. So C template would look like this:
... C stuff...
{{#with c.D}}
{{ partial "show_D" }} // How do I get this partial to have its own controller?
{{/with}}
I guess the new {{control}}
could help here, but I am having a lot of troubles using it (context not being set properly). In addition, it seems to me if it has just been added (and is still very much under development) it probably means there should be another way to do that. Lastly, it feels a bit weird to use two different APIs: "itemController" for list of items, and "{{control}}" for single items - at the end of the day, I am just trying to tie an object to a controller in both cases.
Could someone point me in the right direction here?
Thanks!
PJ