How can I determine if a route exists in Angular2?
I have a function that stores the route to navigate to if the user is unauthorized.
Upon logging in, I use:
this.router.navigate([this.authService.redirectUrl]);
However, I only want to navigate IF the redirectUrl points to a valid route. Is there a way to achieve this, such as:
if (this.authService.redirectUrl is a valid route) {
this.router.navigate([this.authService.redirectUrl]);
}
Is there a method to verify this?