I'm using Angular 5, trying to load a empty-path child route into a empty-path parent layout route. The FullLayoutComponent always loads, and the WhyUsComponent component loads when I visit localhost:4200/why-us.
But I cannot get the FrontpageComponent to load when I visit localhost:4200
If I change the path for FrontPageComponent to front-page, it will load when I visit localhost:4200/front-page.
It seems like empty child path inside empty parent path doesn't work (i've tried all combinations of pathMatch btw)
I need to the FrontpageComponent to load at the root of my site, without any defined path.
RouterModule.forRoot([
{
path: '',
component: FullLayoutComponent,
children: [
{
path: '',
component: FrontpageComponent,
pathMatch: 'full',
data: {
meta: {
title: '',
description: ''
}
}
},
{
path: 'why-us', component: WhyUsComponent, pathMatch: 'full',
data: {
meta: {
title: 'Why Us?',
description: 'Why would you choose us? '
}
}
}] // close children
}
])