You should also additionally to the FormsModule import the ReactiveFormsModule from Angular.
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@NgModule({
imports: [
[...]
FormsModule,
ReactiveFormsModule
],
[...]
})
The problem you receive is becaus you did not import the Formsmodule into your module and because of this ngModel is not recognized as a property of input.
Add following import to your module:
@NgModule({
imports: [
[...]
FormsModule
],
[...]
})
Comments
You should also additionally to the FormsModule import the ReactiveFormsModule from Angular.
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@NgModule({
imports: [
[...]
FormsModule,
ReactiveFormsModule
],
[...]
})