The error says that the FormGroup is not recognized in this module.
Solution:
To solve this error you have to import these modules in every module that uses the FormGroup.
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
After that add FormModule and ReactiveFormsModule into your Module’s import array.
imports: [
FormsModule,
ReactiveFormsModule
],
Sometimes the user thinks that they have added already it in the AppModule and it should inherit from it. But it is not because these modules are exporting the required directives that are only available in importing modules.
Error Factors:
On factor for these errors may be spell error like below;
[Formgroup]=” form” Capital F instead of small f.
[formsGroup] = “form” extra s after form.
Another solution:
Some times this occurs due to the missing import of FormModule, ReactiveFormsModule. For this purpose you have to import it into my parent modules as below;
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 { }
I hope this will help to solve your problem.