如何解决如何在angular8的表中实现双向数据绑定
我在下面的html表中绑定了数组用法数据。表中的两列是可编辑的BillData和Usage。 因此,如果更改了这些列的值,我希望它也应自动反映在usageData数组中。
<table class="my-usagedetail-table">
<tr>
<th class="my-usagedetail-hd" rowspan="2">Service</th>
<th class="my-usagedetail-hd" rowspan="2">Mtr Use</th>
<th class="my-usagedetail-hd" colspan="2">Billing Period</th>
<th class="my-usagedetail-hd" rowspan="2">Bill Days</th>
<th class="my-usagedetail-hd" rowspan="2">Usage</th>
<th class="my-usagedetail-hd" rowspan="2">Rate</th>
</tr>
<tr>
<th class="my-usagedetail-hd">From</th>
<th class="my-usagedetail-hd">To</th>
</tr>
<tr *ngFor="let data of usageData">
<td class = "my-usagedetail-td-readonly">{{data.Service}}</td>
<td class = "my-usagedetail-td-readonly">{{data.MtrUse}}</td>
<td class = "my-usagedetail-td-readonly">{{data.From}}</td>
<td class = "my-usagedetail-td-readonly">{{data.To}}</td>
<td contenteditable="true" class="my-usagedetail-td">{{data.BillDays}}</td>
<td contenteditable="true" class = "my-usagedetail-td">{{data.Usage}}</td>
<td class = "my-usagedetail-td-readonly">{{data.Rate}}</td>
</tr>
</table>
请帮忙吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。