set route for root context angular code example
Example 1: how to create app.routing.module.ts in angular 6
ng generate module app-routing --flat --module=app
Example 2: how to add changes every time you route navigate to page in angular
// Place import at the top
import { Router,NavigationStart} from '@angular/router';
//Place the code below inside your class
constructor(private router: Router){}
ngOnInit(){
this.router.events.subscribe(event =>{
if (event instanceof NavigationStart){
}
})
}