Currently I am working on an Ionic/Angular application and I have encountered a situation where I am attempting to utilize ngModel. Essentially, I am trying to implement the following functionality within my app:
<ion-list>
<ion-item>
<ion-label position="stacked">Name of the Recipe</ion-label>
<ion-input [(ngModel)]="model" ></ion-input>
</ion-item>
</ion-list>
<ion-button (click)="save()">Save</ion-button>
In my TypeScript file, I have defined the variable like this:
public model="";
However, whenever I click on save, the value that is outputted is always an empty string. This behavior is quite perplexing as I have already imported ReactiveFormsModule in my app.module.ts file, which functions correctly on regular pages but fails to work within modals. Has anyone encountered a similar issue before?
I would greatly appreciate any insights or suggestions you might have. Thank you!