import { Routes } from '@angular/router'; import {IndexComponent} from "./pages/body/index/index.component"; import {InitGuardService} from "./utils/initGuard.service"; export const routes: Routes = [ {path: '', pathMatch: 'full', redirectTo: 'login'}, { path: 'login', loadChildren: () => import('./pages/login/login.routes').then(m => m.LOGIN_ROUTES), canActivate: [InitGuardService] }, { path: 'admin', component: IndexComponent, children: [ { path: 'index', loadChildren: () => import('./pages/index/index.routes').then(m => m.INDEX_ROUTES), canActivate: [InitGuardService] }, ] } ];