modal controller get data on dismiss

Solutions on MaxInterview for modal controller get data on dismiss by the best coders in the world

showing results for - "modal controller get data on dismiss"
Bennie
08 Feb 2019
1selectUser(user: User):void {
2  this.modalController.dismiss(user);
3}
4...
5async openUserModal() {
6    const modal = await this.modalCtrl.create({
7      component: UserModalComponent,
8      componentProps: { users: this.users },
9    });
10
11    modal.onDidDismiss()
12      .then((data) => {
13        const user = data['data']; // Here's your selected user!
14    });
15
16    return await modal.present();
17}