How to fix Angular4/5/6 'No provider for ControlContainer'

Problem:

In your Angular2/4/5 application you’re getting the following error message:

error_message.txt
No provider for ControlContainer ("<div class="recall-container mat-elevation-z8">

Solution

You have not added the @angular/forms FormsModule to your module’s import list.

Go to your app.module.ts and add this line to the imports:

app.module.ts
import { FormsModule } from '@angular/forms';

and look for a line like this in your module definition:

app.module_imports.ts
imports: [ /* several import modules may be listed here */ ],

and add FormsModule like this (if there are already imports, add FormsModule to the list):

app.module_imports_fixed.ts
imports: [ FormsModule ],

Check out similar posts by category: Angular, Javascript, Typescript