change the font color based on value angular js

后端 未结 4 886
既然无缘
既然无缘 2020-12-29 09:32

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?

4条回答
  •  别那么骄傲
    2020-12-29 09:56

    You can do it very easily by ng-class and css.

    CSS code

    .Error{color: red;}
    .Warning{color: blue;}
    .Ignored{color: green;}
    

    Html code

  • {{s.Name}} {{s.state}}
提交回复
热议问题