How do I set a property on an itemController?


I have an ArrayController that uses associated itemControllers to track a checked property on the set of models (i.e. whether or not their checkbox is checked).

This part is currently working fine. When I come back to the route, I need to use some information off of the user model to “remember” which were checked.

How can I set the checked property on the specific itemController's? I can get references to the individual models that need “checking”, but model.set('checked', true) doesn’t seem to get picked up by the itemController in that scenario.

Any help would be appreciated!

P.S. I’m trying to set this from the route.


I’ve figured out a way to do it by accessing the itemControllers as controller.get('_subControllers'). But I feel like someone is going to tell me I shouldn’t be doing that.


Yeah, that’s wrong. You have access to all your favorite array functions on the ArrayController that will let you filter, enumerate, through the underlying controllers w/o accessing _subControllers.


Thanks @jasonmit! I think the issue was that I was trying to do operations on the content, rather than the controller. i.e. controller.get('content').forEach(function()..... rather than controller.forEach(function.....