-
-
-
-
angluar12 路由状态监听
activeRouteName = '';
constructor(private router: Router) { (this.router.events.pipe(filter(event => event instanceof NavigationEnd)) as Observable).subscribe(router => {
// do something
console.log('路由结束==>', router)
this.activeRouteName = router.url;
})
}