Change color of bottom in ngfor from array

0

i create a dinamic ionic card and i would change color in each of this but i don’t know how i can do that. i have an array like this

+-------------------------------+
|DESART|COLORWEB|...............|
+------+--------+---------------+
|bla123|#057EEF |...............|
+------+--------+---------------+
|bla232|#F3FF05 |...............|
+------+--------+---------------+
|bla151|#05gg00 |...............|
+------+--------+---------------+
|bla276|#F30005 |...............|
+------+--------+---------------+

and this is my c

  <ion-card class="coworker-card" *ngFor="let itemDotaz of this.MyApp.json_articoli">
    <ion-card-header >
      <ion-card-title>
        <ion-button /*here i must change color*/>
          <ion-icon name="brush-outline"></ion-icon>
        </ion-button>
        {{this.MyApp.DoData(itemDotaz.DESART)}}          {{this.MyApp.DoData(itemDotaz.COLORWEB)}}
      </ion-card-title>
      
    </ion-card-header>

    <ion-card-content>
        sono preseni {{itemDotaz.QTAART}} articoli di tipo {{this.MyApp.DoData(itemDotaz.CODART)}}
    </ion-card-content>
  </ion-card>


</ion-content>

You can use css - nth-child:

This is a really bad idea, especially if that function is named correctly. You have zero control over how many times that function is going to be called (and it’s going to be a ton of times, so it’s a bad idea for performance reasons even if the function itself is idempotent).

Don’t call functions from inside {{}} interpolation expressions. Just put properties in there.