-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathapp-routing.module.ts
More file actions
20 lines (18 loc) · 871 Bytes
/
app-routing.module.ts
File metadata and controls
20 lines (18 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EmployeeComponent } from './employee/employee.component';
import { AddEmployeeComponent } from './add-employee/add-employee.component';
import { LoginComponent } from './login/login.component';
import { LogoutComponent } from './logout/logout.component';
import { AuthGaurdService } from './service/auth-gaurd.service';
const routes: Routes = [
{ path: '', component: EmployeeComponent,canActivate:[AuthGaurdService] },
{ path: 'addemployee', component: AddEmployeeComponent,canActivate:[AuthGaurdService]},
{ path: 'login', component: LoginComponent },
{ path: 'logout', component: LogoutComponent,canActivate:[AuthGaurdService] },
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }