The current plan for Ember is to obviate the need for Controllers (top-level and item controllers) with components.
I believe many use cases for an itemController can be satisfied with a component that holds the state that the itemController would have. However, with itemControllers, ArrayControllers have access to their models wrapped in itemControllers which makes for some pretty nice management of items in an ArrayController.
Here is one example that I have where using an itemController seemed helpful. What is a good way to do this without an itemController?
Some things to keep in mind:
-
Letâs not put the isSelected property in the original model. Letâs say there is a naming collision where items can be selected in other parts of the app.
-
Letâs avoid fragile bookkeeping that might break if an item is destroyed. In other words, having items trigger an action like âaddSelectedItemâ and having the ArrayController keep track of a list of selected items seems fragile to me. If an item is destroyed by some other means (letâs say there is a delete button on each item) then we will get errors about dealing with destroyed objects.