I am updating our app to Ember 1.9.1 and Handlebars 2.0. So far I have been rendering collections like this: JS Bin - Collaborative JavaScript Debugging
Things to note:
- the
itemController
property in the array controller is needed as the included filter works on a property of the item controller instead of the model directly; - each child view has the correct model, controller and view set as can be verified in the Ember Inspector.
How can I convert this to the non-context-switching variety of the each
helper?
My first guess would be
{{#each person in filteredPeople}}
{{render "person" person}}
{{/each}}
This does not work correctly because the itemController
property of the parent causes person
to be an instance of PersonController
instead of the underlying object. So in the view hierarchy I get an instance of PersonController
nested inside of an instance of PersonController
.
Many thanks in advance!