I am using AngularJS and I use ng-repeat to loop and show the details in the page.
Is there a possibility to change the font color based on the value?>
See this example
var myApp = angular.module('myapp',[]);
myApp
.controller('MyCtrl1', function ($scope) {
$scope.vm = {
States: [
{
Name: 'Error',
state: 'error',
color: 'red'
},
{
Name: 'Warning',
state: 'warning',
color: 'blue'
},
{
Name: 'Ignored',
state: 'ignored',
color: 'green'
}
]
};
})
.red{
color: red;
}
.blue{
color: blue;
}
.green{
color: green;
}
-
{{s.Name}} -
{{s.state}}