how to pass data to a modal in ionic 5 code example
Example: 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}`)
}
}