I would like to change the modal component parameter by a value from an array. But I don't know how to do it. When pass the array, it takes the code writing and not the array value.
componentArray: any[] = [{component: 'modal1Page'}, {component: 'modal2Page'}];
async onClick(value: any) {
const myModal = await this.modalController.create({
component: this.componentArray[0],
cssClass: 'modalCss',
componentProps: {
value: value,
}
});
return await myModal.present();
}
It's interpreting like this: " component: this.componentArray[0]; " and i would like it to be interpreting like this: " component: modal1Page; "
Thanks for your help