property filter does not exit on type
来源:3-9 改造股票管理应用
此间少年_
2018-07-16
写回答
1回答
-
心影交叠
2018-07-24
因为你用的是rxjs6.0版本所以代码要稍微变换一下,引入的头文件是import {filter} from 'rxjs/operators';
构造函数的代码是
constructor(public router: Router) {
this.router.events.pipe(
filter((event: Event) => event instanceof NavigationEnd)
).subscribe((event: NavigationEnd) => {
if (event.url === '/dashboard') {
this.pageTitle = '这里是首页';
this.pageDesc = '';
} else if (event.url.startsWith('/stock')) {
this.pageTitle = '股票信息管理';
this.pageDesc = '进行股票信息基本增删改查';
}
});
}642018-12-09