I have created a mat chip like below.
HTML
<mat-chip-list multiple>
<mat-chip class="chip_margin cursor mt-3" *ngFor="let chip of chips" selectable="true"
[selected]="isSelected(chip)" (click)="onClick($event, chip);">
<span class="unselectableText">{{chip.ViewValue}}</span>
</mat-chip>
</mat-chip-list>
TS:
isSelected(chip:any) {
return this.chipCollection.get(chip.value);
}
Problem:
"isSelected" function is calling n number of times how to solve this. Thanks in Advance.