Last active
January 31, 2020 04:44
-
-
Save alexytiger/a06febd1e0197eea0dea55774ec9e34d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { Routes, RouterModule } from '@angular/router'; | |
import { DashboardComponent } from './core/components/dashboard/dashboard.component'; | |
import { NotFoundPageComponent } from './core/containers/not-found-page.component'; | |
import * as guards from './core/guards'; | |
export const routes: Routes = [ | |
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' }, | |
{ | |
path: 'dashboard', | |
component: DashboardComponent, | |
}, | |
{ | |
path: 'market-place', | |
// here we use the TypeScript Dynamic Imports in Angular 8 | |
loadChildren: () => import('./market-place/market-place.module').then(mod => mod.MarketPlaceModule), | |
canActivate: [guards.MetaMaskConnectGuard], | |
}, | |
{ path: '**', component: NotFoundPageComponent }, | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes, { useHash: true, onSameUrlNavigation: 'reload' })], | |
exports: [RouterModule], | |
}) | |
export class AppRoutingModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment