我有一个关于角度激活按钮的查询。方案是:在应用程序列表中,如果用户选择一个应用程序并单击“打开频道”,则应停用其他应用程序。请查看我的HTML
<mat-expansion-panel *ngFor="let a of apps">
<mat-expansion-panel-header>
<mat-panel-title>
{{a.name}}
</mat-panel-title>
<mat-panel-description>
{{a.info}}
</mat-panel-description>
<mat-panel-description>
<button mat-raised-button color="primary" (click)="clickedConnect(a.name, a._id)">Open Channel</button>
</mat-panel-description>
<mat-panel-description>
<button mat-raised-button color="primary" (click)="clickedDisconnect(a._id)">Close Channel</button>
</mat-panel-description>
<mat-panel-description>
<mat-chip-list>
<mat-chip *ngIf="isAppActive(a._id)==true" style="background: green;" selected>Openned</mat-chip>
<mat-chip *ngIf="isAppActive(a._id)==false" style="background: red;" selected>Closed</mat-chip>
</mat-chip-list>**strong text**
</mat-panel-description>
</mat-expansion-panel-header>
</mat-expansion-panel>
答案 0 :(得分:0)
<ng-container *ngFor="let a of apps"> <mat-expansion-panel [disabled]="selectedId && a._id != selectedId "> // rest of the content </mat-expansion-panel> </ng-container>
希望这就是您要的。