35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
import { Routes, RouterModule } from '@angular/router';
|
|
import { NgModule } from '@angular/core';
|
|
import { HomeComponent } from '../home';
|
|
import { LoginComponent } from '../login';
|
|
import { AttachmentMainComponent } from '../attachment/attachmentmain.component';
|
|
import { AuthGuard } from '../route-guard';
|
|
|
|
const appRoutes: Routes = [
|
|
|
|
// { path: '', component: HomeComponent, canActivate: [AuthGuard] },
|
|
|
|
|
|
{ path: 'home', component: HomeComponent },
|
|
{ path: 'login', component: LoginComponent },
|
|
{ path: 'attachment', component: AttachmentMainComponent },
|
|
{ path: 'incidentReport', loadChildren: () => import('../incidentReport/incidentReport.module').then(m => m.IncidentReportModule) },
|
|
|
|
{ path: 'claim', loadChildren: () => import('../claim/claim.module').then(m => m.ClaimModule) },
|
|
{ path: 'audit', loadChildren: () => import('../audit/audit.module').then(m => m.AuditModule) },
|
|
{ path: 'hazard', loadChildren: () => import('../hazard/hazard.module').then(m => m.HazardModule) },
|
|
{ path: 'rehabilitation', loadChildren: () => import('../rehabilitation/rehabilitation.module').then(m => m.RehabilitationModule) },
|
|
{ path: 'person', loadChildren: () => import('../person/person.module').then(m => m.PersonModule) },
|
|
|
|
// otherwise redirect to home
|
|
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
|
{ path: '**', redirectTo: '' },
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' })],
|
|
exports: [RouterModule]
|
|
})
|
|
export class AppRouteModule {}
|
|
// routing =
|