I get this error message:
this.vendorProducts.find(…) is undefined
game.html
<ion-item>
<ion-label>Produk</ion-label>
<ion-select [(ngModel)]="produk" interface="action-sheet" (ionChange)="changeSelectedProduct(vendor);">
<ion-option value="Steam"><img src="assets/imgs/game/steam(us).png" width="50">Steam</ion-option>
<ion-option value="Garena">Garena</ion-option>
<ion-option value="Playstore">Playstore</ion-option>
<ion-option value="Gemcool">Gemcool</ion-option>
<ion-option value="Steamid">Steamid</ion-option>
<ion-option value="Lyto">Lyto</ion-option>
<ion-option value="Megaxus">Megaxus</ion-option>
</ion-select>
</ion-item>
game.ts
changeSelectedProduct(vendor) {
// change selected vendor
console.log(vendor);
this.selectedVendor = vendor;
this.selectedProducts = this.vendorProducts.find(vp => vp.vendor === vendor).products;
}
I wonder why? Thanks in advance.