frontend-smartfarming/agrilink_vocpro/src/app/app.routes.ts

40 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-09-17 06:50:34 +00:00
import { Routes } from '@angular/router';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { LayoutsComponent } from './pages/dashboard/layouts/layouts.component';
import { GraphComponent } from './pages/dashboard/page/graph/graph.component';
2024-09-17 08:14:28 +00:00
import { AuthComponent } from './pages/auth/auth.component';
import { AuthGuard } from './cores/guard/guards/auth.guard';
import { RegisterComponent } from './pages/register/register.component';
2024-09-17 06:50:34 +00:00
export const routes: Routes = [
{
path: '',
redirectTo: 'auth',
pathMatch: 'full'
2024-09-17 06:50:34 +00:00
},
2024-09-17 08:14:28 +00:00
{
path: 'auth',
2024-09-17 08:14:28 +00:00
component: AuthComponent
},
2024-09-17 06:50:34 +00:00
{
path: 'register',
component: RegisterComponent
},
{
path: '',
2024-09-17 06:50:34 +00:00
component: LayoutsComponent,
children: [
2024-09-17 06:50:34 +00:00
{
path: 'dashboard',
component: DashboardComponent,
canActivate: [AuthGuard]
},
2024-09-17 06:50:34 +00:00
{
path: 'graph',
component: GraphComponent,
canActivate: [AuthGuard]
2024-09-17 06:50:34 +00:00
},
]
}
];