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