Skip to content

Commit 345fea5

Browse files
committed
Added route guards and AppComponent to app-routing-module
1 parent 9104abe commit 345fea5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

angular/src/app/app-routing.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import { AppComponent } from './app.component';
88
RouterModule.forChild([
99
{
1010
path: '',
11+
component: AppComponent,
1112
children: [
1213
{
1314
path: 'home',
1415
loadChildren: () => import('./home/home.module').then((m) => m.HomeModule),
16+
canActivate: [AppRouteGuard]
1517
},
1618
{
1719
path: 'about',
1820
loadChildren: () => import('./about/about.module').then((m) => m.AboutModule),
21+
canActivate: [AppRouteGuard]
1922
},
2023
{
2124
path: 'users',
@@ -38,6 +41,7 @@ import { AppComponent } from './app.component';
3841
{
3942
path: 'update-password',
4043
loadChildren: () => import('./users/users.module').then((m) => m.UsersModule),
44+
canActivate: [AppRouteGuard]
4145
},
4246
]
4347
}

0 commit comments

Comments
 (0)