import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; const routes = [ { path : '' , loadChildren : './main/main.module#MainModule' , } , { path : 'projects' , loadChildren : './projects/projects.module#ProjectsModule' , } , { path : 'admin' , loadChildren : './admin/admin.module#AdminModule' , } , { path : '**' , loadChildren : './error/error.module#ErrorModule' , } , ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] , } ) export class AppRoutingModule { }