The full error looks like:
Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’.
<form [formGroup]=”patientCategory”>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/select-option-default/select-option-default.component.ts:5:16
5 templateUrl: ‘./select-option-default.component.html’,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component SelectOptionDefaultComponent
This error occurs due to not adding the Reactive form Module to your app.module.ts file.
Just add and Import ReactiveFormModule to your module file.
Code: app.module.ts
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@NgModule({
declarations: [
AppComponent,
//...
],
imports: [
BrowserModule,
//...
ReactiveFormsModule
],
bootstrap: [AppComponent],
})
export class AppModule { }
I hope this will be helpful to you. Please comment below if any queries. I will try to help you. Share knowledge gets new knowledge.
.