import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; const routes = [ { path : '' , loadChildren : './main/main.module#MainPageModule' } , { path : 'login' , loadChildren : './login/login.module#LoginPageModule' } , { path : 'register' , loadChildren : './register/register.module#RegisterPageModule' } , { path : 'profile' , loadChildren : './profile/profile.module#ProfilePageModule' } , { path : 'edit-profile' , loadChildren : './edit-profile/edit-profile.module#EditProfilePageModule' } , { path : 'main' , loadChildren : './main/main.module#MainPageModule' } , ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }