Skip to content

Instantly share code, notes, and snippets.

@saimon24
Created August 9, 2019 11:46
Show Gist options
  • Save saimon24/1c4178a148defc7fcee01d560ccdb91a to your computer and use it in GitHub Desktop.
Save saimon24/1c4178a148defc7fcee01d560ccdb91a to your computer and use it in GitHub Desktop.
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'home/:index', loadChildren: './details/details.module#DetailsPageModule' },
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment