To fix the error “Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input'”, you need to make sure that the FormsModule is imported in the module where you are using the ngModel
directive.
Here is an example of how you can do this:
- First, import the FormsModule in your module:
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule,
// Other imports
],
// Other properties
})
export class MyModule { }
- Then, use the
ngModel
directive in your component template, like this:
<input [(ngModel)]="name" type="text">
- Finally, make sure that you have defined the
name
property in your component class:
export class MyComponent {
name: string;
}
This should fix the error “Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input'”.

I do SEO