import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { HomeComponent } from './home/home.component' ; import { NotFoundComponent } from './not-found/not-found.component' ; const routes = [ { path : 'collections' , loadChildren : ( ) => import ( './collections/collections.module' ) . then ( m => m . CollectionsModule ) } , { path : 'elements' , loadChildren : ( ) => import ( './elements/elements.module' ) . then ( m => m . ElementsModule ) } , { path : 'views' , loadChildren : ( ) => import ( './views/views.module' ) . then ( m => m . ViewsModule ) } , { path : 'mods' , loadChildren : ( ) => import ( './mods/mods.module' ) . then ( m => m . ModsModule ) } , { path : '' , component : HomeComponent } , { path : '**' , component : NotFoundComponent } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }