I'm using ember.js 1.2 and one of my routes has a very dynamic model. When I jump into the route for the first time or when I paste in the url the model hook of the route fires, then setup controller fires and everything works as expected.
The problem occurs when I come into the route later (but not from the url directly) -this only hits the setupController hook (and the model method never fires). But technically what's changed is the url (and the parent model). And with this model, it's primarily defined from the parent (using that parent model to fetch a new set of dynamic configuration at runtime).
So how can I force the setupController to re-execute the model hook each time this specific route is loaded? (as if the model method was firing each time).
Or ... Should I fetch this dynamic model in setupController and keep the model hook logic-less by having it return an empty object?
Update
App.ChildIndexRoute = Ember.Route.extend(App.ModelMixin, {
setupController: function(controller, model) {
this._super(controller, model);
var parent = this.modelFor('parent');
return this.getForParent(parent).then(function(things) {
controller.set('model', things);
});
}
});