//app-routing.module.ts file
const routes: Routes = [
// for simple path
{
path:'admin',component:UserHomeComponent
}
//child parent context
{
path:'',component:UserSideComponent,
children:[
{
path:'home',component:UserHomeComponent
},
{
path:'checkout',component:CheckoutComponent
}]
},
]
// create a new project with routing enabled
ng new routing-app --routing
content_copy
goToItems() {
this.router.navigate(['items'], { relativeTo: this.route });
}
ng generate module app-routing --flat --module=app