Last active
July 13, 2018 23:58
-
-
Save mcallegari10/e9ab6dbc35b02ef74ffc4abb6ed23776 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RouterModule, Routes, PreloadAllModules } from @angular/router; | |
// You can say to Angular the route is async with the hash at the end of the import | |
export const ROUTES: Routes = [ | |
{ path: '', pathMatch: 'full', redirectTo: 'dashboard' }, | |
{ path: 'dashboard', loadChildren: '../dashboard/dashboard.module#DashboardModule' }, | |
{ path: 'settings', loadChildren: '../settings/settings.module#SettingsModule' }, | |
{ path: 'reports', loadChildren: '../reports/reports.module#ReportsModule' } | |
]; | |
@NgModule({ | |
// ... | |
imports: [ | |
RouteModule.forRoot(ROUTES, { preloadingStrategy: PreloadAllModules }) | |
], | |
// ... | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment