So the way I have it set up right now is that both the parent and the children have references to each other in a circular fashion.
So I have the parent (Games) controller and 2 children (Sort and Filter) controllers. The sort and filter controllers have dynamic options that will be read from a database so they need their own models.
I read the only way to accomplish the circular dependencies was to declare the references like this when declaring the classes:
In the parent controller:
App.GamesController = Ember.ArrayController.extend({
needs: [“filter”, “sort”],
filterController: Ember.computed.alias(“controllers.filter”),
sortController: Ember.computed.alias(“controllers.sort”)
});
And in the children controllers:
App.FilterController = Ember.ArrayController.extend({
needs:“games”,
gamesController: Ember.computed.alias(“controllers.games”)
});
App.SortController = Ember.ArrayController.extend({
needs: “games”,
games: Ember.computed.alias(“controllers.games”); });
I don’t think the way you’re referencing the children from the the route would work in my setup. Does setupController get called after the controller class has been initialized?