If you use this html (please notice #lbl="matChip"):
<mat-chip-list>
<mat-chip *ngFor="let label of item.labels"
#lbl="matChip" (click)="selectChip(lbl)">
{{label}}
</mat-chip>
</mat-chip-list>
Your selectChip
method will receive a MatChip and then you can do the following:
selectChip(item: MatChip) {
item.toggleSelected();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…