我已经完成了将我的应用程序更新为Angular 6(它是在5.2版本中).
我有一个错误语法:
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';
...
constructor(private router: Router) {}
this.router.events.filter
(event => event instanceof NavigationEnd).subscribe((res) =>
{
// DO something
});
Run Code Online (Sandbox Code Playgroud)
错误TS2339:类型'Observable'上不存在属性'filter'.
Angular 6中的语法是什么?
谢谢