1.路由监听
//监听路由变化this.router.events .filter(event => event instanceof NavigationEnd) .map(() => this.activatedRoute) .map(route => { while (route.firstChild) route = route.firstChild; return route; }) .subscribe((event) => { this.colorChange(); });