import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: 'dashboard', loadChildren: './pages/dashboard/dashboard.module#DashboardModule' }, { path: 'user', loadChildren: './pages/user/user.module#UserModule' }, { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, { path: '**', loadChildren: './pages/not-found/not-found.module#NotFoundModule' } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }