I am lazy loading a feature module as shown in Routing.module.ts from an app-routing.module.ts. The default route in featured routing module load the LccpTrackerComponent which contains 3 child routes. The template for the LccpTrackerComponent uses Angular Material tab component. I am trying to add the routerLink directive in the mat-tab title to route to a corresponding child component, but the route doesn't fire. Does anyone know how to make this work? Thanks.
Template
<article>
<section>
<mat-tab-group>
<mat-tab label="Consults"><a routerLink="consults" /></mat-tab>
<mat-tab label="Screening"><a routerLink="screening" /></mat-tab>
<mat-tab label="Noduled"><a routerLink="noduled" /></mat-tab>
</mat-tab-group>
</section>
<router-outlet></router-outlet>
</article>
Routing.module.ts
const routes: Routes = [{
path: '',
component: LccpTrackerComponent,
children: [{
path: 'consults',
component: ConsultComponent,
pathMatch: 'full',
resolve: {
consultSummary: LccpResolver
}
},
{
path: 'screening',
component: ScreeningComponent,
pathMatch: 'full',
resolve: {
enrolledSummary: ScreeningResolver
}
},
{
path: 'noduled',
component: NoduledComponent,
pathMatch: 'full',
resolve: {
noduledSummary: NoduledResolver
}
}
]
}, ];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LccpRoutingModule {}