import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { appPath } from 'src/app/app-path.const'; const routes: Routes = [ { path: appPath.home, loadChildren: './home/home.module#HomeModule' }, { path: appPath.p2, loadChildren: './p2/p2.module#P2Module' }, { path: appPath.p3, loadChildren: './p3/p3.module#P3Module' }, { path: appPath.p4, loadChildren: './p4/p4.module#P4Module' }, { path: appPath.p5, loadChildren: './p5/p5.module#P5Module' } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }