我需要为 Angular 中的方法获取一些数据。这是代码:
我需要像下面的 editNpi(data) 一样将数据放入 addNpi()
有没有办法做到这一点?谢谢!
<mat-dialog-content>
<ip-data-table
[columnData]="columnData"
[data]="data"
[actionTemplate]="npiActions"
></ip-data-table>
</mat-dialog-content>
<mat-dialog-actions>
<ip-show-obsolete
[disabled]="false"
[clearCheckbox]="clearCheckbox"
(showObsolete)="showObsolete($event)"
>
<button class="mr-2" mat-button (click)="addNpi()">Add</button>
<button mat-button mat-dialog-close>Close</button>
</ip-show-obsolete>
</mat-dialog-actions>
<ng-template #npiActions let-data="data">
<button type="button" [disabled]="!data.active" mat-menu-item (click)="editNpi(data)">
Edit
</button>
<button type="button" [disabled]="!data.active" mat-menu-item>Remove</button>
</ng-template>