One good way I can think of to delay LoadingRoute
would be to delay the rendering of the template using Ember.run.later
, which works like setTimeout
but is much safer by running inside runloop.
App.LoadingRoute = Ember.Route.extend({ renderTemplate: function() { Ember.run.later(this, function() { this.render(); }, 1000);
If the model
tag resolves a promise before the timeout expires, then LoadingRoute
will not be displayed at all, this is the behavior you might want.
Hope this helps.
source share