【发布时间】:2016-10-30 19:05:18
【问题描述】:
I know how to get the selected option value when a select changes (as shown below), but how do I get the displayed text of the selected option?
模板:
<select (change)="onChange($event.target.value)">
<option *ngFor="let option of activeDropdown.options" value="{{option.value}}">
{{option.text}}
</option>
</select>
组件:
onChange(value: string) {
console.log(value);
}
谢谢!
【问题讨论】:
标签: angular