0

It seems router.changes.subscribe is deprecated.

What can be used in place of this?

I want to do something on each router changes, so please provide me help what could be done as router.

techraf
  • 64,883
  • 27
  • 193
  • 198
Ashutosh Singh
  • 806
  • 1
  • 8
  • 20

1 Answers1

0

I have got this solution.

router.events.subscribe(event:Event => {
if(event instanceof NavigationStart) {
}
// NavigationEnd
// NavigationCancel
// NavigationError
// RoutesRecognized

}

Ashutosh Singh
  • 806
  • 1
  • 8
  • 20