Angular Reactive form Error:-ngtsc(-998002)

Viewed 34

How do I resolve this error?

Can't bind to 'formGroup' since it isn't a known property of 'form'.ngtsc(-998002) I have import ReactiveFormModule in app.module.ts and gorm builder and form group in component.ts file.

ts file code:-

ngOnInit() {
    // this.fullScreen.isFullscreen=false;

    this.forgotPasswordForm = this.formBuilder.group({
      userid: ['', Validators.required]
    });
    
  }

enter image description here

1 Answers

Try adding ReactiveFormsModule and FormsModule to your relevant module imports array.

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