change the font color based on value angular js

后端 未结 4 914
既然无缘
既然无缘 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:52

    You can achieve this with following code:

  • {{s.Name}} {{s.state}}
  • Where 'color-red', 'color-blue', 'color-green' are your css classes.

    See it in plunker.

    Check documentation about ng-class.

提交回复
热议问题