fixed rout
This commit is contained in:
38
src/app/app.routes.ts
Normal file
38
src/app/app.routes.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { authGuard, loginGuard } from './guards/auth.guard';
|
||||
import { LoginComponent } from './components/login/login.component';
|
||||
import { DashboardComponent } from './components/dashboard/dashboard.component';
|
||||
import { ActiveChecksComponent } from './components/active-checks/active-checks.component';
|
||||
import { HistoryComponent } from './components/history/history.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/login',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
component: LoginComponent,
|
||||
canActivate: [loginGuard]
|
||||
},
|
||||
{
|
||||
path: 'dashboard',
|
||||
component: DashboardComponent,
|
||||
canActivate: [authGuard]
|
||||
},
|
||||
{
|
||||
path: 'active-checks',
|
||||
component: ActiveChecksComponent,
|
||||
canActivate: [authGuard]
|
||||
},
|
||||
{
|
||||
path: 'history',
|
||||
component: HistoryComponent,
|
||||
canActivate: [authGuard]
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: '/login'
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user