@@ -3,7 +3,8 @@ <h2>Single selection</h2>
33 < p > Select your favorite color</ p >
44
55 < mat-form-field >
6- < mat-select placeholder ="Colors " [(ngModel)] ="selectedColor ">
6+ < mat-label > Colors</ mat-label >
7+ < mat-select [(ngModel)] ="selectedColor ">
78 < mat-option *ngFor ="let color of colors " [value] ="color.value ">
89 {{ color.label }}
910 </ mat-option >
@@ -16,7 +17,8 @@ <h2>Multiple selection</h2>
1617 < p > Pick toppings for your pizza</ p >
1718
1819 < mat-form-field >
19- < mat-select placeholder ="Toppings " [(ngModel)] ="selectedTopping " multiple >
20+ < mat-label > Toppings</ mat-label >
21+ < mat-select [(ngModel)] ="selectedTopping " multiple >
2022 < mat-option *ngFor ="let topping of toppings " [value] ="topping.value ">
2123 {{ topping.label }}
2224 </ mat-option >
@@ -29,7 +31,8 @@ <h2>Grouped options</h2>
2931 < p > Pick your Pokemon</ p >
3032
3133 < mat-form-field >
32- < mat-select placeholder ="Pokemon " [(ngModel)] ="selectedPokemon ">
34+ < mat-label > Pokemon</ mat-label >
35+ < mat-select [(ngModel)] ="selectedPokemon ">
3336 < mat-optgroup *ngFor ="let group of pokemon " [label] ="group.label ">
3437 < mat-option *ngFor ="let creature of group.pokemon " [value] ="creature.value ">
3538 {{ creature.label }}
@@ -44,21 +47,24 @@ <h2>Colors</h2>
4447
4548 < div class ="select-a11y-spacer ">
4649 < mat-form-field color ="primary ">
47- < mat-select placeholder ="ZIP code ">
50+ < mat-label > ZIP code</ mat-label >
51+ < mat-select >
4852 < mat-option value ="2000 "> 2000</ mat-option >
4953 < mat-option value ="2100 "> 2100</ mat-option >
5054 </ mat-select >
5155 </ mat-form-field >
5256
5357 < mat-form-field color ="accent ">
54- < mat-select placeholder ="State ">
58+ < mat-label > State</ mat-label >
59+ < mat-select >
5560 < mat-option value ="alaska "> Alaska</ mat-option >
5661 < mat-option value ="alabama "> Alabama</ mat-option >
5762 </ mat-select >
5863 </ mat-form-field >
5964
6065 < mat-form-field color ="warn ">
61- < mat-select placeholder ="Language ">
66+ < mat-label > Language</ mat-label >
67+ < mat-select >
6268 < mat-option value ="english "> English</ mat-option >
6369 < mat-option value ="spanish "> Spanish</ mat-option >
6470 </ mat-select >
@@ -67,21 +73,24 @@ <h2>Colors</h2>
6773
6874 < div class ="select-a11y-spacer ">
6975 < mat-form-field color ="primary ">
70- < mat-select placeholder ="Digimon " multiple >
76+ < mat-label > Digimon</ mat-label >
77+ < mat-select multiple >
7178 < mat-option value ="mihiramon "> Mihiramon</ mat-option >
7279 < mat-option value ="sandiramon "> Sandiramon</ mat-option >
7380 </ mat-select >
7481 </ mat-form-field >
7582
7683 < mat-form-field color ="accent ">
77- < mat-select placeholder ="Drink " multiple >
84+ < mat-label > Drink</ mat-label >
85+ < mat-select multiple >
7886 < mat-option value ="water "> Water</ mat-option >
7987 < mat-option value ="coke "> Coke</ mat-option >
8088 </ mat-select >
8189 </ mat-form-field >
8290
8391 < mat-form-field color ="warn ">
84- < mat-select placeholder ="Theme " multiple >
92+ < mat-label > Theme</ mat-label >
93+ < mat-select multiple >
8594 < mat-option value ="light "> Light</ mat-option >
8695 < mat-option value ="dark "> Dark</ mat-option >
8796 </ mat-select >
0 commit comments