【发布时间】:2018-10-09 15:16:59
【问题描述】:
我想将按钮的值添加到我的程序中。
首先我展示一些按钮。
<button *ngFor="let row of buttonTable.rows" mat-raised-button class="btn btn-sm" value={{row}} (click)="addLab(this.value)">{{row}}</button>
我的 addLab() 方法是
addLab(value:any):void{
this.formTable.rows.push([value]);
}
而我的buttonTable是这样的。
declare interface oneLineTable {
rows: string[][];
}
但我无法通过这种点击方法获得价值。有人有什么想法吗?
【问题讨论】:
标签: angular forms button click