In my application I like to create a master (CRUD) for physician. I have a physician component for creating, editing and listing. A separate component for viewing it. I would like to URL's like
physician/create
physician/list
physician/edit/3
So I created route with children
const routes: Routes = [
{
path: 'physician',
children: [
{ path: 'list', component: PhysicianComponent },
{ path: 'create', component: PhysicianComponent },
{ path: 'update/:id', component: PhysicianComponent },
{ path: 'view/:id', component: PhysicianViewComponent }
]
}
For create, update and list I want to use the same component, but different output using some conditions inside the component class