I recently found out about the undocumented $ locationChangeStart event in AngularJS when I tried to determine where, within the framework, I should redirect users to the login page if their session is invalid.
I am listening to the event using the following:
$scope.$on("$locationChangeStart", function (event, nextLocation, currentLocation) {
where nextLocation and previousLocation are the absolute URLs for locations in the application.
My question is this: Does AngularJS allow you to map a URL to a route, like its internal routing mechanism, to determine if an absolute URL matches a specific route?
If not, what would be the best way to determine a route based on an absolute URL?
source share