我在Angular5应用程序中使用此代码:
<mat-selection-list>
<mat-list-option *ngFor="let activityType of activityTypes" [selected]="isActivityTypeSelected(activityType)" (click)="addSelectedActivityType(activityType)">{{activityType | translate}}</mat-list-option>
</mat-selection-list>
在某些情况下,我会停用 mat-list-option 。因此我尝试了这样([disabled] =&#34; closedCalendarEvent&#34;):
<mat-list-option *ngFor="let activityType of activityTypes" [selected]="isActivityTypeSelected(activityType)" (click)="addSelectedActivityType(activityType)" [disabled]="closedCalendarEvent">{{activityType | translate}}</mat-list-option>
但它不起作用,复选框仍然可以点击。 有谁知道我可以做什么来禁用 mat-list-option 的复选框?