afterModel (resolvedModel, transition) Promisepublic
This hook is called after this route's model has resolved. It follows identical async/promise semantics to beforeModel but is provided the route's resolved model in addition to the transition, and is therefore suited to performing logic that can only take place after the model has already resolved.
App.PostsRoute = Ember.Route.extend({
afterModel: function(posts, transition) {
if (posts.get('length') === 1) {
this.transitionTo('post.show', posts.get('firstObject'));
}
}
});
Refer to documentation for beforeModel for a description of transition-pausing semantics when a promise is returned from this hook.
Parameters:
-
resolvedModel
Object - the value returned from `model`, or its resolved value if it was a promise
-
transition
Transition
Returns:
-
Promise - if the value returned from this hook is a promise, the transition will pause until the transition resolves. Otherwise, non-promise return values are not utilized in any way.
Please login to continue.