Friday 22 March 2019

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

ERROR:

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


Solution :

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

Here's the example of a basic module with ReactiveFormsModule import:



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 { }

No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...