1
votes

With the new async router and Ember Data, setupController will only be called once the model has loaded since the model hook will call App.Foo.find(id) which is a promise (http://emberjs.com/guides/routing/asynchronous-routing/).

But is there a way to not only wait for the model itself to load, but its relationships as well?

I have route where the model has "childs". I need both the model and childs to be loaded before the transition can continue.

1

1 Answers

0
votes

How about using afterModel?

App.FooRoute = Ember.Route.extend({
    model: function() {
        // get your data
    },

    afterModel: function(model) {
        // this is fired after your models are loaded.
        // you can access the model too.
    }
});