[已解决]angular7报错,求解:in src/app/content/content.component.ts(18,7): error TS2345
来源:3-9 改造股票管理应用

厘汨
2018-11-26
************************************************
angular7报错,求解
:in src/app/content/content.component.ts(18,7): error TS2345: Argument of type ‘MonoTypeOperatorFunction’ is not assignable to parameter of type ‘OperatorFunction<Event, Event>’.
代码有错,修改为:
constructor(public router:Router) {
router.events.pipe(
filter(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='进行股票信息基本增删改查';
}
});
另外自己导包的名称不同,一个大写,一个没有大写的问题。导致出现下面的报错
WARNING in ./node_modules/@angular/Router/fesm5/router.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
写回答
1回答
-
油条C
2018-11-30
下载RXJS 5.x版本
00
相似问题