Skip to content

Instantly share code, notes, and snippets.

@rexar1988
Created October 8, 2018 16:51
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 rexar1988/288c417079b6bd08367d1e3f84c7970b to your computer and use it in GitHub Desktop.
Save rexar1988/288c417079b6bd08367d1e3f84c7970b to your computer and use it in GitHub Desktop.
Angular 2+: Routing Module
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { InsideLayoutComponent } from './core/inside-layout/inside-layout.component';
const AppRouter: Routes = [
{
path: '', component: InsideLayoutComponent, children: [
{
path: 'black-market', loadChildren: './modules/market/market.module#MarketModule'
},
{
path: 'user', loadChildren: './modules/user/user.module#UserModule'
},
{
path: 'adv', loadChildren: './modules/adv/adv.module#AdvModule'
}
]
},
{
path: 'login', loadChildren: './modules/auth/auth.module#AuthModule'
},
{
path: '', pathMatch: 'full', loadChildren: './modules/home/home.module#HomeModule'
}
];
@NgModule({
imports: [RouterModule.forRoot(AppRouter)],
exports: [RouterModule]
})
export class AppRoutesModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment