【发布时间】:2020-07-17 20:36:34
【问题描述】:
我有一个服务表,其中每一行都包含一个下拉菜单,每个条目都是一个服务类型。服务类型包含标题和成本。当我为每一行选择一种服务类型时,我想显示相应的成本。
<table class="table table-striped table-responsive table-hover">
<tr>
<th>Service name</th>
<th>Service type</th>
<th>Price</th>
<th></th>
</tr>
<tr *ngFor="let service of content.services">
<td>{{service.title.fr}}</td>
<td>
<select name="servicetype" class="form-control" [(ngModel)]="selectedServiceType" (change)="showPrice($event)">
<option value=""></option>
<option *ngFor="let type of service.servicetypes" [ngValue]="type">
{{type.title.fr}}
</option>
</select>
</td>
<td></td>
<td><input name="service" type="radio" (change)="selectThisService(service)"></td>
</tr>
</table>
【问题讨论】:
标签: angular html-table html-select ngfor