import { Routes } from '@angular/router'; import { AppIdGuard } from './guards/appid.guard'; import { AuthGuard } from './guards/auth.guard'; export const routes: Routes = [ { path: 'login', loadComponent: () => import('./login/login.component').then(m => m.LoginComponent) }, { path: 'forgot-password/:token', loadComponent: () => import('./forgot-password/forgot-password.component').then(m => m.ForgotPasswordComponent) }, { path: 'forgot-password', loadComponent: () => import('./forgot-password/forgot-password.component').then(m => m.ForgotPasswordComponent) }, { path: 'register', loadComponent: () => import('./register/register.component').then(m => m.RegisterComponent) }, { path: '404', loadComponent: () => import('./shared/components/not-found/not-found.component').then(m => m.NotFoundComponent) }, { path: ':appId', children: [ { path: 'home', loadComponent: () => import('./home/home.component').then(m => m.HomeComponent) }, { path: 'usersettings', loadComponent: () => import('./user-settings/user-settings.component').then(m => m.UserSettingsComponent) }, { path: 'add-carnet', loadComponent: () => import('./carnet/add/add-carnet.component').then(m => m.AddCarnetComponent) }, { path: 'edit-carnet/:headerid', loadComponent: () => import('./carnet/edit/edit-carnet.component').then(m => m.EditCarnetComponent) }, { path: 'add-holder', loadComponent: () => import('./holder/add/add-holder.component').then(m => m.AddHolderComponent) }, { path: 'edit-holder/:holderid', loadComponent: () => import('./holder/edit/edit-holder.component').then(m => m.EditHolderComponent) }, { path: '', redirectTo: 'home', pathMatch: 'full' } ], canActivate: [AuthGuard, AppIdGuard] }, { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: '**', redirectTo: '/404' } ];