Как отменить переход в onBefore? Этот фрагмент, вероятно, может показать свое намерение:UI-маршрутизатор | приостановить переход | onBefore
$transitions.onBefore({}, (trans) => {
console.log("before a transition");
console.log(trans);
//I want to broadcast an event here
//notifying inner components that it's about to switch state
//The event will contain the trans
//So I actually don't need to wait here, I just need to suspend the trans at this point.
//The inner component will respond by emitting and event.
//That event will contain approval status, and the trans object.
//My code can simply check the approval status; If false,
//it simply does nothing. Otherwise it will pick and resume the trans.
});
Благодарность