How to call a function on every route change in angular2

前端 未结 4 663
清歌不尽
清歌不尽 2021-02-01 02:50

My module.ts,

import { NgModule }      from \'@angular/core\';
import { BrowserModule } from \'@angular/platform-browser\';
import { RouterModule,Router }   from         


        
4条回答
  •  生来不讨喜
    2021-02-01 02:58

    You can refer:NgRx Router

    Catch all 'Go' actions in ngrx effects to do things just before the route changes, or in the reducer of this action to call a function after the route changes.

提交回复
热议问题