diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1e0d9ec..44b8c1b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,11 +1,14 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { AuthGuard } from './auth/auth.guard'; import { HomeComponent } from './home/home.component'; import { NonAuthenticatedComponent } from './non-authenticated/non-authenticated.component'; +import { UsersComponent } from './users/users.component'; const routes: Routes = [ { path: '', pathMatch: 'full', redirectTo: 'home' }, { path: 'home', component: HomeComponent }, + { path: 'users', canActivate: [AuthGuard], component: UsersComponent }, { path: 'non-auth', component: NonAuthenticatedComponent }, ]; diff --git a/src/app/app.component.html b/src/app/app.component.html index bf4278e..c3bdf10 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -2,7 +2,7 @@ {{ title }} - +