Modal backdrop does not work

Hello dear community,

I want my modal pops up (with backdrop) rather than a new page. I followed some tutorials but the backdrop is not working (it should be activated by default). I am sure I am missing something.

Here the code from the page where the modal is opened.

openPhonesModal(){

  const myModalOptions: ModalOptions = {
      showBackdrop: true,
      enableBackdropDismiss: false
  };

  const myModalData = {
  phone1: '01 239 239',
  phone2: '901 200 438'
  };

  const myModal: Modal = this.modal.create('ModalseephonesPage',{phones: myModalData},myModalOptions);

  myModal.present();

}


Here the code of the modal itself:

export class ModalseephonesPage {

constructor(private navParams: NavParams, private view: ViewController) {
}

ionViewWillLoad() {
const phones = this.navParams.get(‘phones’);
console.log(phones);
}

closeModal(){
this.view.dismiss();
}

}

I hope I provided enough information. Thank you in advance.

Paul

1 Like