When working with angular you may encounter the following error : Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’. This post will show how to fix it.
Solution
NgModel is a angular directive that comes with the FormsModule. Getting the error means that you didn’t imported the FormsModule in your app.module.ts. Import it like below :
1 2 3 4 5 6 7 8 9 10 11 |
import { FormsModule } from '@angular/forms'; [...] @NgModule({ imports: [ ..., FormsModule ], ... }) |
References