In Angular2 how do I check if a route exists?
I have a method that remembers which route to navigate to if the user is not authorised.
On login I have:
this.router.navigate([this.authService.redirectUrl]);
But I only want to navigate IF the redirectUrl references a valid route, something like ..
if (this.authService.redirectUrl is a valid route) {
this.router.navigate([this.authService.redirectUrl]);
}
Is there any way to check this?