import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; const appRoutes = [ { path : '' , loadChildren : ( ) => import ( './home/home.module' ) . then ( m => m . HomeModule ) } , { path : 'custom' , loadChildren : ( ) => import ( './custom/custom.module' ) . then ( m => m . CustomModule ) } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( appRoutes , { useHash : true , relativeLinkResolution : 'legacy' } ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }