I am working with using the Angular router to dynamically add breadcrumbs. I have followed several examples and have gotten them to successfully work.
However, if I attempt incorporate a lazy-loaded module, I get the error:
Root segment cannot have matrix parameters
I have researched that issue and have not been able to find satisfactory information/fixes.
I've created a plunk with what I am trying to accomplish to save from extensive amounts of code on this page: https://plnkr.co/edit/505x2r
How can I continuing utilizing the dynamic breadcrumb creation from the router, but use lazy-loaded routes as well.
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import { RootComponent } from 'src/root/root.component';
import { IndexComponent } from 'src/index/index.component';
import { SignupComponent } from 'src/signup/signup.component';
import { SigninComponent } from 'src/signin/signin.component';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: RootComponent,
children: [
{
path: 'signin',
loadChildren: 'src/signin/signin.module#SigninModule'
},
{
path: 'signup',
component: SignupComponent,
data: {
breadcrumb: 'Sign Up'
}
},
{
path: '',
component: IndexComponent
}
]
}
])
],
exports: [
RouterModule
]
})
export class RootRoutingModule {}