I’m trying to get the value of the selected option, but I have no idea how I’m supposed to do that. Literally I spent 2-3 hours looking all over the internet. I just want to get the quantity when the Buy Now button is clicked.
HTML:
<ion-item>
<ion-label>Quantity</ion-label>
<ion-select [(ngModel)]="qty">
<ion-option value="1" selected="true">1</ion-option>
<ion-option value="2">2</ion-option>
<ion-option value="3">3</ion-option>
</ion-select>
</ion-item>
<button ion-button full (click)="addToCart()">Buy Now</button>
TS:
export class ProductPage {
qty: any;
constructor(public navCtrl: NavController) {
}
addToCart() {
console.log(this.qty);
}
}