Angular 2: How to get the selected value from different options of a form?

前端 未结 4 832
醉酒成梦
醉酒成梦 2020-12-16 16:58

I would like to use a

You can do the following:

@ViewChild('quantity') quantity: ElementRef;

console.log(this.quantity.nativeElement.value);  // will print value of the currently selected option

提交回复
热议问题