angular8监听路由变化

angular8监听路由变化

  ngOnInit() {
	this.listenRouterChange();
  }
  listenRouterChange() {
    this.rooterChange = this.router.events.pipe(
      filter(event => event instanceof NavigationEnd)
    ).subscribe((res: any) => {
      console.log(8888888);
    });
  }

你可能感兴趣的:(angular8监听路由变化)