I'm using ui-router 1.0.0-alpha.5. Old events are deprecated there.
so I'm trying to convert
$rootScope.$on('$stateChangeStart', ($event) => {
//some logic
$event.preventDefault();
});
into:
$transitions.onEnter({}, ($transition$) => {
//...
});
how could I prevent default action from here?
Looks like I found the answer:
$transitions.onEnter({}, ($transition$) => {
return $q.reject()
});
i.e. you need to return rejected promise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With