【发布时间】:2020-04-22 01:05:20
【问题描述】:
我想在我的角度组件的选择标签中更改选定选项时获取该值:
<select name="types" class="custom-select form-control rounded" (change)="changeType($event.target.value)">
<option selected value="allTypes">Tous</option>
<option *ngFor="let type of types; let i = index" [value]="types.id">
{{types[i].name}
</option>
</select>
changeType(type) {
this.chosenType = type
console.log('changed type', type)
this.getData()
}
当日志选择类型我得到未定义!
【问题讨论】:
标签: html typescript select events option