I was just wondering if there is a way to know if someone is changing the route of the URL.
As an example, I have something like this in my html:
<a ng-href="#/somewhere">To somewhere</a>
and I was using this:
$scope.$on('$routeChangeSuccess', function (scope, next, current) {
//Some code
})
However, I just realized that I need to run this code before changing the URL. Is there a way to to this and also to have the same next
and current
to know where am I going to be redirected and from where?