import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; const routes = [ { path : '' , pathMatch : 'full' , redirectTo : 'customers' } , { path : 'customers' , loadChildren : ( ) => import ( 'app/customers/customers.module' ) . then ( m => m . CustomersModule ) } , { path : 'orders/:id' , loadChildren : ( ) => import ( 'app/orders/orders.module' ) . then ( m => m . OrdersModule ) } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes , { relativeLinkResolution : 'legacy' } ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }