Sometimes, we want to fix Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ in Angular.
In this article, we’ll look at how to fix Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ in Angular.
How to fix Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ in Angular?
To fix Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ in Angular, we should add FormsModule
and ReactiveFormsModule
into the imports
array.
For instance, in our app.module.js file, we write
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
to import the 2 modules from the @angular/forms
module.
Then in the imports
array, we write
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
and
imports: [
FormsModule,
ReactiveFormsModule
],
to add them to our app so we can use them.
Conclusion
To fix Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ in Angular, we should add FormsModule
and ReactiveFormsModule
into the imports
array.