Sending action to item controller from array controller
ember.js
Solution
You can iterate over the controller itself and that returns the item controller.
App.IndexController = Em.ArrayController.extend({
itemController: 'foo',
actions:{
talkToChildren:function(){
this.forEach(function(itemController){
itemController.send('foo');
});
}
}
});
App.FooController = Em.ObjectController.extend({
count: 1,
actions:{
foo:function(){
this.incrementProperty('count');
}
}
})
http://emberjs.jsbin.com/fagosifu/1/edit
Problem
I have a simple ArrayController which has the itemController attribute defined. I'd like to send an action from the ArrayController to each item's backing controller. I'm not sure how to "bubble down" this action though.