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()
});
ie you need to return rejected promise .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.