I have one simple case to create variable in button html share into another button
<td style="width: 3rem">
<button
mat-icon-button
type="button"
[matMenuTriggerData]="{ data: data }"
class="cell-action"
[matMenuTriggerFor]="actionsMenu"
(click)="id = data.id"
>
<mat-icon
style="font-size: 24px"
[icIcon]="icMoreHoriz"
></mat-icon>
</button>
</td>
see into [matMenuTriggerData] = {data: data}
<ng-template let-data="data" matMenuContent>
<button mat-menu-item [routerLink]="'./>
<mat-icon [icIcon]="icPageView"></mat-icon>
<span>Detail</span>
</button>
<!-- <button mat-menu-item (click)="dd(id)">
<mat-icon [icIcon]="icArrowDownward">Canceled</mat-icon>
<span>Unduh</span>
</button> -->
<!-- <button *ngIf="statusDelete" mat-menu-item (click)="alertDialog(id)">
<mat-icon [icIcon]="icDelete"></mat-icon>
<span >Hapus</span>
</button> -->
<button *ngIf="data.status != 'Canceled'" mat-menu-item (click)="alertDialog(id)">
<mat-icon [icIcon]="icDelete"></mat-icon>
<span >Hapus</span>
</button>
</ng-template>
Top comments (0)