-1

I know this may be duplicate question of "Can't bind to 'formGroup' since it isn't a known property of 'form'"

I found solution that i have to import { REACTIVE_FORM_DIRECTIVES } from '@angular/forms'.

But where can i add this reactive form?

Now i'm working in applyjob.component.html i think i have to add reative form directives in applyjob.component.ts but its not working.

The answer will be appreciated!

Rohit Verma
  • 2,571
  • 3
  • 21
  • 42

1 Answers1

4

formGroup, formControl, etc are all directives that are exposed as a part of the ReactiveFormsModule. If you want to use these directives in a Component, you'll have to either import the ReactiveFormsModule in the Module that this Component is registered in. Or you'll have to export the ReactiveFormsModule from some other module(SharedModule for instance) and then import that module in the module that you have this Component registered in.

Did you add this?:

import { ReactiveFormsModule } from '@angular/forms';
...
@NgModule({
  ...,
  declarations: [..., ApplyJobComponent, ...]
  imports: [..., ReactiveFormsModule, ...],
  ...
})
export class YourModule {...}
...
SiddAjmera
  • 32,111
  • 5
  • 45
  • 85