RRB
RRB

Reputation: 2116

Angular material select not opening options

My mat select option do not show for some reason. The label or the option do not show.

Here is my code

<mat-form-field>
  <mat-label>Tags</mat-label>
  <input matInput placeholder="Tags" value="" class="mat-input-custom">
</mat-form-field>
<mat-form-field>
  <mat-label>Subjects</mat-label>
  <input matInput placeholder="Subjects" value="" class="mat-input-custom">
</mat-form-field>
<mat-form-field class="full-width">
  <mat-label>Resolution</mat-label>
  <mat-select formControlName="resolution">
    <mat-option>HD</mat-option>
    <mat-option>4K</mat-option>
    <mat-option>Amateur</mat-option>
  </mat-select>
</mat-form-field>

I created a stackblitz showing the code here https://stackblitz.com/edit/angular-material-select-demo-oksugs

Upvotes: 0

Views: 3718

Answers (1)

ViqMontana
ViqMontana

Reputation: 5688

Look into your console to see errors. The error is happening due to your input, which in turn is causing issues with the mat-select. You need to import the MatInputModule module.

Here is your updated StackBlitz.

Upvotes: 1

Related Questions