I am trying to use <router-outlet></router-outlet>
within an Angular Material popup dialog.
However, the router-outlet part does not render anything, or log anything to the console.
If I add the <router-outlet></router-outlet>
to the HTML content of the component that pops up the dialog(ContextBuyerPinComponent), then it works fine.
The routes look like this:
const demoRoutes: Routes = [
{
path: 'demo',
children: [
{ path: 'register-email', component: RegisterEmailComponent },
{
path: 'context-buyer-pin',
component: ContextBuyerPinComponent,
children: [
{ path: 'services', component: ContextPinServicesComponent },
{ path: 'emails', component: ContextPinEmailsComponent },
{ path: 'details', component: ContextPinDetailsComponent }
]
}
]
}
];
The dialog is opened via the ContextBuyerPinComponent like this:
this.matDialog.open(ContextBuyerPinDialogComponent, this.config);
.
And the ContextBuyerPinDialogComponent HTML is as follows:
<mat-toolbar color="primary" class="mat-elevation-z4">
<app-tab [icon]="'room_service'" [displayType]="getDisplayType()" [caption]="'Local Services'"
routerlink="demo/context-buyer-pin/services">
</app-tab>
<app-tab [icon]="'email'" [displayType]="getDisplayType()" [caption]="'Emails'"
routerlink="demo/context-buyer-pin/emails">
</app-tab>
<app-tab [icon]="'map-pin'" [displayType]="getDisplayType()" [isSvg]="true" [caption]="'Pin Details'"
routerlink="demo/context-buyer-pin/details">
</app-tab>
</mat-toolbar>
<router-outlet></router-outlet>
I have tried using a named router-outlet as an alternative, but with no success.
The toolbar is using the app-tab component, and that is using the routerLinkActive directive which is working fine, so it looks like the routes are working.
How do I get this working?