Answers for "ionic modal pass data"

3

ionic modal pass data

...
async presentModal() {
    const modal = await this.modalController.create({
      component: ModalPage,
      componentProps: { 
        foo: 'hello',
        bar: 'world'
      }
    });
    return await modal.present();
}
...
@Component()
export class ModalPage implements OnInit {
  foo;
  bar;

  ngOnInit() {
    console.log(`${foo} ${bar}`)
  }
}
Posted by: Guest on November-29-2020
1

ionic modal controller pass parameter

let profileModal = await this.modalCtrl.create({
	component: SearchModal,
	componentProps: {
		specs: [this.specialization_selected]
	}
});
Posted by: Guest on December-13-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language