私は現在angular2を使用しています。typescriptで選択されたチェックボックスの値を取得する方法は?
<select id="color" class="colorDropDown" (change)="signalSelected($event, 'color')">
<option *ngFor="let color of colors" value={{axis}} [selected]="color == channelPropertyModel.color">
{{color}}
</option>
</select>
マイtypescriptファイルがあるように私は
signalSelected(event: any, selection: string) {
//Add the newly entered value and the corresponding field name into the dictionary
this.selectedUIInfo[selection] = event.currentTarget.value;
}
しかし、メソッドを呼び出していますドロップダウンから任意の色を変更するには
this.colors = ["ORANGE", "WHITE", "RED", "GREEN", "BLUE", "YELLOW", "CYAN", "SKYBLUE"];
を次のように私は私のhtmlコードを持っています私はevent.currentTarget.valueで選択された色を取得していません。ドロップダウンから選択した色を取得する方法を提案してください。
サンプルモック以下をご確認ください以下のように選択した項目にチェックするプロパティを使用して、それを割り当てる必要がありますジュソン?データ – Aravind
これは答えとしてどのようにマークされていますか?リンクされたPlunkerのチェックボックスはどこですか? – Aravind