You can use the binding system. sonsController
should observe the parentsController.selected
property, and then update its contents.
Here is an example of how you can do this:
App.parentsController = Em.ArrayController.create({ content: [], selected: null }); App.sonsController = Em.ArrayController.create({ parentControllerBinding: 'App.parentsController', content: [], updateContent: function() { var selected = this.getPath('parentController.selected'); var newContent = Ember.A(); newContent.pushObject(selected); this.set('content', newContent); }.observes('parentController.selected') });
And here is related to jsfiddle .
NB: you can also directly bind the selected property:
App.sonsController = Em.ArrayController.create({ parentSelectedBinding: 'App.parentsController.selected', ... updateContent: function() { ... }.observes('parentSelected') })
source share