My problem is actually very similar to the one found here:
AngularJs - cancel route change event
In short, I\'m using $routeChangeStart and trying to change
Since version 1.3.0 you can actually use the newly introduced preventDefault-method. With that you can cancel the current route change and then apply your own custom redirect as shown in this github-issue:
$rootScope.$on("$routeChangeStart", function (event, next, current) {
if (next.access) {
event.preventDefault();
$rootScope.$evalAsync(function() {
$location.path('/login');
});
}
});
I implemented this method in my own project and it works perfectly. Hope it helps anyone else who stumbles across it.