Ionic 4 ngModel on input

I am getting error "Can’t bind to ‘ngModel’ since it isn’t a known property of ‘ion-input’ " on ionic 4.
how to use ngModel with Ionic 4 ?


<ion-label position=“floating”>Name</ion-label>

<ion-input type=“text” [(ngModel)]=“” inputmode=“text”></ion-input>


1 Like

You need to include FormsModule from @angular/forms in the module file for the page you are trying to use ngModel on.


ok Thanx I forgot to add formsModule in app module.

1 Like

import { FormsModule } from ‘@angular/forms’;

1 Like