Following along with the Getting Started Guide I have this http://jsbin.com/enutit/2/edit
My question is how come I can't remove the itemController from this each helper
<ul id="todo-list">
{{#each controller itemController="todo"}}
<li {{bindAttr class="isCompleted:completed isEditing:editing"}}>
and then add
itemController: 'todo',
to Todos.TodosController and have it work?
Because the controller's properties are not the same as the {{each}}
helper's properties.
{{each}}
internally creates an instance of Ember.Handlebars.EachView
to display each item in the Todos.TodosController
's content
property. It is this view that needs the itemController
property so that it can create a new Todos.TodoController
(note the singular form) instance for each child view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With