Skip to content

Instantly share code, notes, and snippets.

@considine
Last active October 9, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save considine/bdfd4ba32e154acca459e22b9183a609 to your computer and use it in GitHub Desktop.
Save considine/bdfd4ba32e154acca459e22b9183a609 to your computer and use it in GitHub Desktop.
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
const routes: Routes = [
{
path: "",
redirectTo: "home",
pathMatch: "full"
},
{
path: "home",
loadChildren: "./home/home.module#HomePageModule"
},
{
path: "home/:category",
loadChildren: "./home/home.module#HomePageModule"
},
{
path: "posts/:id",
loadChildren: "./post-detail/post-detail.module#PostDetailPageModule"
},
{
path: "categories",
loadChildren: "./categories/categories.module#CategoriesPageModule"
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment