data dismiss modal with id code example
Example 1: data-dismiss= modal in jquery
$(document).ready(function(){
$("#myModal").modal('show');
$(".btn").click(function(){
$("#myModal").modal('hide');
});
});
Example 2: modal controller get data on dismiss
selectUser(user: User):void {
this.modalController.dismiss(user);
}
...
async openUserModal() {
const modal = await this.modalCtrl.create({
component: UserModalComponent,
componentProps: { users: this.users },
});
modal.onDidDismiss()
.then((data) => {
const user = data['data'];
});
return await modal.present();
}