【发布时间】:2018-08-21 12:40:23
【问题描述】:
我正在使用 angular-material select 创建一个下拉菜单,其中提供了选择多个值的选项。
<accordion [showArrows]="true" class="programstyle">
<accordion-group heading="EVENTS" [isOpened]="true">
<div class="">
<mat-form-field class="width100">
<mat-select class="width100" placeholder="Events" [(ngModel)]="studentInput.programType" (change)="filter()" id="programTypeValueId" name="programTypeValueId">
<mat-option disabled>Select Events</mat-option>
<mat-option *ngFor="let program of programs" [value]="program.campusEventId">{{program.eventName}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</accordion-group>
<accordion-group heading="SKILLS">
<div class="">
<mat-form-field class="width100">
<mat-select multiple class="width100" placeholder="Select Skills" [(ngModel)]="studentInput.skills" (change)="filter()" id="skillTypeValueId" name="skillTypeValueId">
<mat-option disabled>Select Skills</mat-option>
<mat-option *ngFor="let skill of skills" [value]="skill.lookupValueId">{{skill.lookupValue}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</accordion-group>
<accordion-group heading="INTERESTS">
<div class="">
<mat-form-field class="width100">
<mat-option>Select Interests</mat-option>
<mat-select multiple class="width100" placeholder="Select Interests" [(ngModel)]="studentInput.interest" (change)="filter()" id="interestTypeValueId"
name="interestTypeValueId">
<mat-option *ngFor="let interest of interests" [value]="interest.lookupValueId">{{interest.lookupValue}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</accordion-group>
</accordion>
这是 HTML 部分。
我使用了选择事件来将选项定义为选择事件。但是我在启用复选框的情况下得到了这个。我不希望下拉列表中的第一个选项启用复选框。有什么办法可以让我选择不带复选框的第一个选项?
【问题讨论】:
-
您能否将我的回答标记为已接受?谢谢。
标签: javascript html css angular angular-material