Angular: How to change the color of cell table if condition is true

后端 未结 3 1880
情深已故
情深已故 2021-02-14 10:35

I have an object which has a variable called changeColor. In my html table I want to change the cell color if changeColor is true. I am using angular.<

3条回答
  •  醉酒成梦
    2021-02-14 11:00

    Don't put so much logic in your views. Try this instead:

    ngClass directive

    It will allow you to change the td class based on an expression.

提交回复
热议问题