Error: mat-form-field must contain a MatFormFieldControl.
See original GitHub issueBug, feature request, or proposal:
When doing a karma/jasmine test I get an error on the <mat-form-field> tag. This in combination with a <mat-select>
<mat-form-field> <mat-select name="country" placeholder="Country" [(ngModel)]="address.countryName" class="input-full-width"> <mat-option *ngFor="let country of countries | orderBy: 'name'" [value]="country.name">{{ country.name }}</mat-option> </mat-select> </mat-form-field>
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Using angular 4.4.5 material 2.0.0-beta.12
Is there anything else we should know?
When running the project it’s working okay, but just the test gives an error and fails.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:39 (3 by maintainers)
Top Results From Across the Web
mat-form-field must contain a MatFormFieldControl
Error: mat-form-field must contain a MatFormFieldControl. This error occurs when you have not added a form field control to your form field.
Read more >mat-form-field must contain a MatFormFieldControl error fix in ...
This error occurs when you have missed to add a form field control to your form field. Table of Contents. what are form...
Read more >mat-form-field must contain a MatFormFieldControl - Elite Corner
This error usually occurs in 4 scenarios when we missed to import module for specific component. Problem 1: MatInputModule or MatFormFieldModule ...
Read more >mat-form-field must contain a MatFormFieldControl
mat -form-field must contain a MatFormFieldControl. I got an error while I was trying to add Angular material mat-form-field control. Here is how ......
Read more >Form field
link Error: mat-form-field must contain a MatFormFieldControl ... This error occurs when you have not added a form field control to your form...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You have to add to app.module.ts:
You have to add matInput to input