Reputation: 1463
Below code was running fine before I upgraded to 6. Not sure what changed in between! I have required modules imported as well
MatInputModule,
MatSelectModule,
MatFormFieldModule
<mat-input-container>
<mat-select placeholder="Sort By" formControlName="sortBy">
<mat-option *ngFor="let sortByObject of sortByList" [value]="sortByObject.value">
{{ sortByObject.label }}
</mat-option>
</mat-select>
</mat-input-container>
Upvotes: 13
Views: 14532
Reputation: 2437
This CSS class has been removed beginning version
6.0.0-beta.5 (2018-03-23)
mat-input-container has been deprecated, instead use mat-form-field
For details of breaking changes in 6.0.0-beta.5:
https://github.com/angular/material2/blob/master/CHANGELOG.md#600-beta5-2018-03-23
For details of breaking changes in general, refer:
https://github.com/angular/material2/blob/master/CHANGELOG.md
Upvotes: 29
Reputation: 1463
As per https://material.angular.io/components/form-field/overview we are now supposed to use mat-form-field
<mat-form-field>
<mat-select placeholder="Select">
<mat-option value="option">Option</mat-option>
</mat-select>
</mat-form-field>
Upvotes: 7