app.routing.ts 663 B

1234567891011121314151617181920212223242526
  1. import {Routes} from '@angular/router';
  2. import {AuthLayoutComponent} from './core';
  3. import {AdminLayoutComponent} from './core/admin-layout/admin-layout.component';
  4. import {AuthGuard} from './classes/guards/auth.guard';
  5. export const AppRoutes: Routes = [{
  6. path: '',
  7. canActivate: [AuthGuard],
  8. component: AdminLayoutComponent,
  9. children: [{
  10. canActivate: [AuthGuard],
  11. path: 'user',
  12. loadChildren: './components/user/user.module#UserModule'
  13. },
  14. ]
  15. }, {
  16. path: '',
  17. component: AuthLayoutComponent,
  18. children: [{
  19. path: 'auth',
  20. loadChildren: './components/auth/auth.module#AuthModule'
  21. }]
  22. }, {
  23. path: '**',
  24. redirectTo: 'auth/404'
  25. }];