How do you provide support for routing in your Angular application? code example
Example 1: home page routing in angular
const routes: Routes = [
{ path: 'home_page_path', component: HomePageComponent }
];
add this in app routing file
Example 2: how to add changes every time you route navigate to page in angular
import { Router,NavigationStart} from '@angular/router';
constructor(private router: Router){}
ngOnInit(){
this.router.events.subscribe(event =>{
if (event instanceof NavigationStart){
}
})
}