Skip to content
Advertisement

Angular – No provider for FormBuilder

I am using Angular 9.

I am getting the following error:

No provider for FormBuilder

It has been reported in many cases, and the general solution appears to be to add the FormsModule to the app.module.ts file.

e.g.

JavaScript

I have tried this, but am still getting the error.

JavaScript

Question

Am I maybe doing something that’s changed in Angular 9? What do I need to do to fix this?

My code:

login.component.ts

JavaScript

app.module.ts

JavaScript

Advertisement

Answer

form builder is ReactiveFormsModule

JavaScript

you’ll also need this module to use formGroup and formControl directives.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement