FormsModule has imported on app.module.ts but the problem persists.
Can't bind to 'ngModule' since it isn't a known property of 'input'.
("item</h1>
<form (submit)="addItem()" #form="ngForm">
Can anyone help me?
FormsModule has imported on app.module.ts but the problem persists.
Can't bind to 'ngModule' since it isn't a known property of 'input'.
("item</h1>
<form (submit)="addItem()" #form="ngForm">
Can anyone help me?
In your app.module.ts add the following import:
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
and add them to the imports section:
imports: [
FormsModule,
ReactiveFormsModule
],
Edit:
There are two possible reasons:
Missing FormsModule
, hence Add this to your Module,
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule
]
Since you don't use the reactive forms you can remove ReactiveFormsModule
from the imports.
Check the syntax/spelling of [(ngModel)]
in the input tag.