11import { NgModule } from '@angular/core' ;
22import { RouterModule } from '@angular/router' ;
3- import { AppComponent } from './app.component' ;
43import { AppRouteGuard } from '@shared/auth/auth-route-guard' ;
5- import { HomeComponent } from './home/home.component' ;
6- import { AboutComponent } from './about/about.component' ;
7- import { UsersComponent } from './users/users.component' ;
8- import { TenantsComponent } from './tenants/tenants.component' ;
9- import { RolesComponent } from 'app/roles/roles.component' ;
10- import { ChangePasswordComponent } from './users/change-password/change-password.component' ;
4+ import { AppComponent } from './app.component' ;
115
126@NgModule ( {
137 imports : [
@@ -16,12 +10,39 @@ import { ChangePasswordComponent } from './users/change-password/change-password
1610 path : '' ,
1711 component : AppComponent ,
1812 children : [
19- { path : 'home' , component : HomeComponent , canActivate : [ AppRouteGuard ] } ,
20- { path : 'users' , component : UsersComponent , data : { permission : 'Pages.Users' } , canActivate : [ AppRouteGuard ] } ,
21- { path : 'roles' , component : RolesComponent , data : { permission : 'Pages.Roles' } , canActivate : [ AppRouteGuard ] } ,
22- { path : 'tenants' , component : TenantsComponent , data : { permission : 'Pages.Tenants' } , canActivate : [ AppRouteGuard ] } ,
23- { path : 'about' , component : AboutComponent , canActivate : [ AppRouteGuard ] } ,
24- { path : 'update-password' , component : ChangePasswordComponent , canActivate : [ AppRouteGuard ] }
13+ {
14+ path : 'home' ,
15+ loadChildren : ( ) => import ( './home/home.module' ) . then ( ( m ) => m . HomeModule ) ,
16+ canActivate : [ AppRouteGuard ]
17+ } ,
18+ {
19+ path : 'about' ,
20+ loadChildren : ( ) => import ( './about/about.module' ) . then ( ( m ) => m . AboutModule ) ,
21+ canActivate : [ AppRouteGuard ]
22+ } ,
23+ {
24+ path : 'users' ,
25+ loadChildren : ( ) => import ( './users/users.module' ) . then ( ( m ) => m . UsersModule ) ,
26+ data : { permission : 'Pages.Users' } ,
27+ canActivate : [ AppRouteGuard ]
28+ } ,
29+ {
30+ path : 'roles' ,
31+ loadChildren : ( ) => import ( './roles/roles.module' ) . then ( ( m ) => m . RolesModule ) ,
32+ data : { permission : 'Pages.Roles' } ,
33+ canActivate : [ AppRouteGuard ]
34+ } ,
35+ {
36+ path : 'tenants' ,
37+ loadChildren : ( ) => import ( './tenants/tenants.module' ) . then ( ( m ) => m . TenantsModule ) ,
38+ data : { permission : 'Pages.Tenants' } ,
39+ canActivate : [ AppRouteGuard ]
40+ } ,
41+ {
42+ path : 'update-password' ,
43+ loadChildren : ( ) => import ( './users/users.module' ) . then ( ( m ) => m . UsersModule ) ,
44+ canActivate : [ AppRouteGuard ]
45+ } ,
2546 ]
2647 }
2748 ] )
0 commit comments