【发布时间】:2016-02-15 11:29:24
【问题描述】:
我正在使用 Angular 2 (TypeScript)。
我想对新选择做点什么,但我在onChange() 中得到的始终是最后一个选择。如何获得新的选择?
<select [(ngModel)]="selectedDevice" (change)="onChange($event)">
<option *ngFor="#i of devices">{{i}}</option>
</select>
onChange($event) {
console.log(this.selectedDevice);
// I want to do something here with the new selectedDevice, but what I
// get here is always the last selection, not the one I just selected.
}
【问题讨论】:
标签: angular typescript html-select