I'm currently facing an issue where I am passing a string as a parameter to a Modal (specifically a master/detail modal) and although the Modal opens successfully, the string is being returned as undefined.
Below is the TypeScript code for the parent component:
editReminder(event, data){
console.log(data);
let myModal = this.modalCtrl.create(ReminderDetailsPage, data);
myModal.present();
}
The HTML file displays a list of reminders using ngFor (reminder of reminders). The parameter 'data' is passed like this in the HTML:
<button ion-fab mini class="mini-button" (click)="editReminder($event, reminder)">
<ion-icon name="create"></ion-icon>
</button>
When I console.log(data), it correctly logs the reminder. However, when trying to retrieve it in the ReminderDetails modal:
export class ReminderDetailsPage {
EditedReminder: string = this.navParams.get('data');
It returns undefined. Both pages have imported navParams and declared them in the constructor.