I have some Ember code in a route where I am waiting on a transition object in order to act after the transition completes:
willTransition: function (transition) {
...
// Wait until the transition has finished before continuing.
transition.then(function () {
// Transition successful
...
}, function () {
// Transition aborted
...
});
}
The "successful transition" function is called in all but one case in my app. This case is when the transition is to a route which performs a transitionTo in its redirect method. The call to transitionTo aborts the original transition - the one I'm waiting on in my code above - and replaces the active transition with a new one. The promise I'm waiting on is then rejected so my abort handler is called.
Is there any way I can get the new transition object and wait on that?