如何获取 Angular 中 mat-chip 的值?

How to get value of mat-chip in Angular?

我正在尝试从 angular html 页面调用打字稿函数。我想在函数中传递一个参数。该参数将是一个布尔值,表示是否选择了 mat-chip。我用谷歌搜索但找不到解决方案。有什么想法吗?

<mat-chip-list>
  <mat-chip [selected] = "isActive">Active People<mat-chip>
  <mat-chip [selected] = "!isActive">Inactive People<mat-chip>
<mat-chip-list>

<button mat-icon-button >
  <mat-icon aria-label="download" (click) = "doSomething(value-of- 
  chip1)>get_app</mat-icon>
</button>

看起来你已经有了一个变量,你不能把它传进去吗?

<mat-chip-list>
  <mat-chip [selected]="isActive">Active People<mat-chip>
  <mat-chip [selected]="!isActive">Inactive People<mat-chip>
<mat-chip-list>

<button mat-icon-button >
  <mat-icon aria-label="download" (click)="doSomething(isActive)>get_app</mat-icon>
</button>