Is it possible to change the color of text on a page based on a specific value?
<div [ng-Style]="color":colorFont({{item.temp.day}})> {{item.temp.day}} {{vm.symbal}}</div><br>
The data {{item.temp.day}}
is a numerical value that determines the color of the text. "ntvg" represents string values that also influence the text color.
If item.temp.day is greater than 0, the font color will be red. Otherwise, it will be blue.
Here is the script:
$scope.colorFont=function(var templiche){
if (parseFloat(templiche)>0) return color="red";
else {
return color="blue";
}
}