/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components-examples/material/select/select-optgroup/select-optgroup-example.html
30 строк
916 B
Kristiyan Kostadinov
docs(multiple): switch docs examples to new control flow
06 ноя 2023, 18:51
06 ноя 2023, 18:51
99b62ba
Код
Авторство
О чём код?
<h4>mat-select</h4> <mat-form-field> <mat-label>Pokemon</mat-label> <mat-select [formControl]="pokemonControl"> <mat-option>-- None --</mat-option> @for (group of pokemonGroups; track group) { <mat-optgroup [label]="group.name" [disabled]="group.disabled"> @for (pokemon of group.pokemon; track pokemon) { <mat-option [value]="pokemon.value">{{pokemon.viewValue}}</mat-option> } </mat-optgroup> } </mat-select> </mat-form-field> <h4>native html select</h4> <mat-form-field> <mat-label>Cars</mat-label> <select matNativeControl> <optgroup label="Swedish Cars"> <option value="volvo">volvo</option> <option value="saab">Saab</option> </optgroup> <optgroup label="German Cars"> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </optgroup> </select> </mat-form-field>