I'm currently facing an issue regarding accessing data in my alert controller
let alert = this.alertCtrl.create({
title: 'Edit Index',
inputs:this.customIndexes,
buttons:[
{
text: 'Cancel',
role: 'cancel',
handler: data=> {
console.log('Cancel clicked');
}
},
{
text: 'Save',
handler: data=>{
console.log(data);
/*for(let item of this.customIndexes)
{
this.customIndexes[item.name].value = data[item.name];
}*/
this.postEditedIndex(this.customIndexes);
}
}
]
});
alert.present();
When the user presses the save button, how can I retrieve the data?
My inputs are dynamic with the specified array structure like
customIndexes: { name: string, value: string, placeholder: string }[] = [];]
The function displays all fields that are populated into custom indexes, but how can I access them from the data object in the save button handler?