1// Place import at the top
2import { Router,NavigationStart} from '@angular/router';
3
4//Place the code below inside your class
5constructor(private router: Router){}
6
7ngOnInit(){
8 this.router.events.subscribe(event =>{
9 if (event instanceof NavigationStart){
10
11 }
12 })
13}