2
I’m getting data on a API and I intend to check if percent_change_1h is less than 0, and if so displays a different text color.
<ion-row>
<ion-col>
<ion-label ng-if="top.percent_change_1h < 0" style="color: #b21a91;">
<b>1H: </b>{{top.percent_change_1h}}
</ion-label>
<ion-label ng-if="top.percent_change_1h > 0">
<b>1H: </b>{{top.percent_change_1h}}
</ion-label>
</ion-col>
</ion-row>
How can I make this process of comparison, in case less than 0 present a color, and if it is greater than or equal to zero present another?
But what’s the problem? Isn’t your code working? Which part doesn’t? To me, it seems to be correct.
– Roberto de Campos