ngclass to values ​that are fetched from a * ngFor Keyvalue They don't work

Viewed 27

hello I am bringing values ​​through a keyValue, the data is coming in a normal way but at the moment of giving a ngClass it does not assign the css

    <div *ngFor="let label of customersLabelCard | keyvalue" [ngClass]=" 
          {'bg__amber': label.value.yellow  === '1'}"
          class="label " fxFlex="none">
      </div>
1 Answers
```
if customersLabelCard is json 

<div *ngFor="let label of customersLabelCard | keyvalue" [ngClass]=" 
          {'bg__amber':  customersLabelCard['yellow']=='1' && label.key=='yellow'}"
          class="label " fxFlex="none">
      </div>
  
customersLabelCard = {
   
    yellow:"1"
  }
can u try this for apply class that matched yellow to 1


```


```
if customersLabelCard is array 
<div *ngFor="let label of customersLabelCard | keyvalue" [ngClass]=" 
          {'bg__amber':  label['value'].yellow == '1'}"
          class="label " fxFlex="none">
      </div>

customersLabelCard=[{
yellow:'1'}]

```
Related