Created
October 8, 2018 16:51
-
-
Save rexar1988/288c417079b6bd08367d1e3f84c7970b to your computer and use it in GitHub Desktop.
Angular 2+: Routing Module
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 { 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