Cant bind to formGroup since it isnt a known property of form


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

The above error is shown in your Angular application when you forget to import FormsModule and ReactiveFormsModule in your module file app.module.ts.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatTabsModule } from '@angular/material/tabs';
import { NewEmployeeComponent } from './new-employee/new-employee.component';
import { AllEmployeeComponent } from './all-employee/all-employee.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CreateOfferComponent } from './offers/create-offer/create-offer.component';
import { CreateOfferPopupComponent } from './offers/create-offer-popup/create-offer-popup.component';

@NgModule({
  declarations: [
    AppComponent,
    NewEmployeeComponent,
    AllEmployeeComponent,
    CreateOfferComponent,
    CreateOfferPopupComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    MatTabsModule,
    FormsModule,
    ReactiveFormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }