Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active January 31, 2020 04:44
Show Gist options
  • Save alexytiger/a06febd1e0197eea0dea55774ec9e34d to your computer and use it in GitHub Desktop.
Save alexytiger/a06febd1e0197eea0dea55774ec9e34d to your computer and use it in GitHub Desktop.
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