Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active January 11, 2020 02:59
Show Gist options
  • Save alexytiger/c7c5aa46ec4db2b37772f2f2c07d9dc4 to your computer and use it in GitHub Desktop.
Save alexytiger/c7c5aa46ec4db2b37772f2f2c07d9dc4 to your computer and use it in GitHub Desktop.
e-book
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import * as fromContainers from './containers';
import * as fromComponents from './components';
import * as guards from './guards';
const routes: Routes = [
{
path: '',
redirectTo: 'products',
pathMatch: 'full',
},
{
path: 'products',
component: fromComponents.MarketPlaceHomeComponent,
children: [
{
path: '',
component: fromContainers.ViewProductCollectionComponent,
canActivate: [guards.ProductsLoadedGuard],
children: [
{
path: ':id',
component: fromContainers.ViewPurchaseContractComponent,
},
{
path: '',
component: fromComponents.ProductDetailHomeComponent
},
]
},
{
path: 'make/new',
component: fromContainers.NewPurchaseContractComponent,
pathMatch: 'full',
},
]
}
];
@NgModule({
imports: [
RouterModule.forChild(routes),
],
exports: [RouterModule]
})
export class MarketPlaceRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment