I am using ionic 7 with angular to build social app and I want to use two way binding to get the data from the input field but ngModel is not recognise Here is the html content:
<div class="post-input">
<ion-item>
<ion-input
placeholder="Write your today's post ..."
[(ngModel)]="postText"
[ngModelOptions]="{standalone: true}"
></ion-input>
</ion-item>
<ion-button class="post-btn" color="medium" (click)="post()">
<ion-icon name="pencil-outline"></ion-icon>
</ion-button>
and the ts file:
import { Component } from '@angular/core';
import { IonicModule } from '@ionic/angular';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
standalone: true,
imports: [IonicModule],
})
export class HomePage {
postText!: string
constructor() {}
post() {
}
}
Now I am getting the error Can't bind to 'ngModelOptions' since it isn't a known property of 'ion-input' and the old solutions is not working.