Right now, afterModel
and redirect
are almost aliases; specifically, the default implementation of Route#afterModel
calls redirect
. The only difference is that the return value of redirect()
is not used in any way, so you can't, say, return a promise from redirect
and expect the transition to pause, which you'd be able to do with afterModel
.
Scumbag machty tried to deprecate redirect
, was met with pushback, and removed the soft deprecation. Now he's wondering if they are semantically separate enough to keep both around.
afterModel
is the last of promise-aware route-entry-validation hooks, which is to say that beforeModel
, model
, and afterModel
allow you to return promises that pause the transition until they resolve, and if they reject (or transitionTo
elsewhere), the transition gets aborted. I call them route-entry-validation hooks because one of their main jobs is to validate that the route in question can actually be entered at this time. Part of this validation