The element mat-select
is acting funny. See below.
the code
<mat-form-field>
<input matInput placeholder="Name" #NameInput>
</mat-form-field>
<mat-select placeholder="How Many?">
<mat-option>One</mat-option>
<mat-option>Two</mat-option>
<mat-option>Three</mat-option>
<mat-option>Four</mat-option>
<mat-option>Five</mat-option>
</mat-select>
results
Wrapping mat-select
in mat-form-field
gives me the following error:
The mat-form field must contain MatFormFieldControl. Did you forget to add matInput to the original input element or textarea?
However, including input
with matInput
shows both input
, and mat-select
together, making it look strange. How to get around this?
source
share