Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’

To fix this error, you just need to import ReactiveFormsModule from @angular/forms in your module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
port { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ReactiveFormsModule,
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

You can even import both the ReactiveFormsModule and FormsModule into your app if you need to support both Template Forms and Reactive Forms in the same Angular application or feature.

Once you’ve updated your module file to include the ReactiveFormsModule, your app and new form should work.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments