cic-staff-client/src/app/app-routing.module.ts

25 lines
678 B
TypeScript
Raw Normal View History

2020-10-30 16:16:05 +01:00
import { NgModule } from '@angular/core';
2021-05-10 18:15:25 +02:00
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { AuthGuard } from '@app/_guards';
2020-10-30 16:16:05 +01:00
const routes: Routes = [
2021-05-10 18:15:25 +02:00
{ path: 'auth', loadChildren: () => import('@app/auth/auth.module').then((m) => m.AuthModule) },
{
path: '',
loadChildren: () => import('@pages/pages.module').then((m) => m.PagesModule),
canActivate: [AuthGuard],
},
{ path: '**', redirectTo: '', pathMatch: 'full' },
];
2020-10-30 16:16:05 +01:00
@NgModule({
2021-05-10 18:15:25 +02:00
imports: [
RouterModule.forRoot(routes, {
preloadingStrategy: PreloadAllModules,
2021-05-12 16:10:42 +02:00
useHash: true,
2021-05-10 18:15:25 +02:00
}),
],
exports: [RouterModule],
2020-10-30 16:16:05 +01:00
})
2021-05-10 18:15:25 +02:00
export class AppRoutingModule {}