How to render the content of ng-content
in the component and the menu?
I try to do using the answer from this question How to use multiple ng-content in the same component in Angular 2?, But it's not works as expected.
When I open the menu then the buttons are disappear from the component.
How to fix that? I want to have the buttons in the component and in the menu.
usage:
<container>
<button mat-raised-button (click)="foo()">foo</button>
<button mat-raised-button (click)="bar()">bar</button>
</container>
container:
<section id="buttons">
<ng-container *ngTemplateOutlet="contentTpl"></ng-container>
</section>
<button mat-button [matMenuTriggerFor]="menu">Menu</button>
<mat-menu #menu="matMenu">
<ng-container *ngTemplateOutlet="contentTpl"></ng-container>
</mat-menu>
<ng-template #contentTpl><ng-content></ng-content></ng-template>