#Mat-button-toggle-group HELP ;(

6 messages · Page 1 of 1 (latest)

still karma
#

item ???

#
    <mat-button-toggle *ngFor="let listTask of taskTypeList | keyvalue" [value]="item.key    ... OR  .... item.value">
      <p>{{ item.key }}</p>
OR 
      <p>{{ item.value }}</p>
    </mat-button-toggle>
  </mat-button-toggle-group> ```
still karma
#

<mat-button-toggle *ngFor="let listTask of taskTypeList | keyvalue" [value]="item.key">
<p>item = {{ item | json }}</p>
</mat-button-toggle>

#

????

#

mmmm enum don"t like it , i check

#
export enum TaskType {
  BMW = 1,
  MERCEDES = 2,
  VOLVO = 3,
  AUDI = 4,
}
...
...
<mat-button-toggle-group #toggleName="matButtonToggleGroup" multiple>
  <mat-button-toggle *ngFor="let listTask of taskType | keyvalue" [value]="listTask.key">
    <p>{{ listTask.key }}</p>
    <p>{{ listTask.value }}</p>
  </mat-button-toggle>
</mat-button-toggle-group>

...
...

taskType = TaskType;         // important

it works 😉