When working with Angular you may encounter the error : Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’. This post shows how to fix it.
Solution
This error indicates that your module is missing the ReactiveFormsModule import. Import it like below :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule, FormsModule, ReactiveFormsModule ], declarations: [ AppComponent ], bootstrap: [AppComponent] }) export class AppModule { } |
If you have a multi module application. You need to import the ReactiveFormsModule in each module.