import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { OwnerComponent } from './component/owner/owner.component'; import { HorseComponent } from './component/horse/horse.component'; import { ListHorsesComponent } from './component/list-horses/list-horses.component' import { AddHorseComponent } from './component/add-horse/add-horse.component'; import { UpdateHorseComponent } from './component/update-horse/update-horse.component'; import { AddOwnerComponent } from './component/add-owner/add-owner.component'; import { UpdateOwnerComponent } from './component/update-owner/update-owner.component'; const routes: Routes = [ {path: '', redirectTo: 'owner', pathMatch: 'full'}, {path: 'owner', component: OwnerComponent}, {path: 'owner/add', component: AddOwnerComponent}, {path: 'owner/:id/edit', component: UpdateOwnerComponent}, {path: 'horse', component: ListHorsesComponent}, {path: 'horse/add', component: AddHorseComponent}, {path: 'horse/:id/edit', component: UpdateHorseComponent}, {path: 'horse/:id', component: HorseComponent}, ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }