Can anyone help me solve the issue in my ionic app where a modal is fired twice when hitting an ion-button?
<ion-button (click)="editProduct(p.id)" fill="clear">
<ion-icon name="cloud-upload"></ion-icon>
</ion-button>
editProduct(id) {
// retrieve product data by id
this.afs.collection("products").doc(id)
.valueChanges()
.subscribe(data => {
this.product = data
// call modal and pass product id
this.modalProduct(id);
});
}
async modalProduct(id) {
const modal = await this.modalCtrl.create({
component: AdminProductPage,
componentProps: {
'id': id,
'title': this.product.title,
'description': this.product.description,
'price': this.product.price,
'image': this.product.image
}
});
await modal.present();
}