import { NgModule } from '@angular/core' ; import { PreloadAllModules , RouterModule , Routes } from '@angular/router' ; const routes = [ { path : '' , loadChildren : ( ) => import ( './home/home.module' ) . then ( m => m . HomePageModule ) } , { path : 'settings' , loadChildren : ( ) => import ( './settings/settings.module' ) . then ( m => m . SettingsPageModule ) } , { path : 'details' , loadChildren : ( ) => import ( './details/details.module' ) . then ( m => m . DetailsPageModule ) } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes , { preloadingStrategy : PreloadAllModules } ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }