在Angular2中,如何检查路由是否存在?
登录时我有:
this.router.navigate([this.authService.redirectUrl]);
但我只想导航如果redirectUrl引用了一个有效的路由,比如..
if (this.authService.redirectUrl is a valid route) { this.router.navigate([this.authService.redirectUrl]); }
有没有办法检查这个?