Ng-style with condition

后端 未结 7 1569
旧巷少年郎
旧巷少年郎 2021-01-11 09:25

How can I apply style on some item in a list that satisfy listed condition:

        
7条回答
  •  半阙折子戏
    2021-01-11 10:24

    I think it would be best to use ng-class for your problem. You then make a new class for the red background, eg:

    
    

    And then use this class according to the condition:

    {{item.name}}

    (don't forget the single quotes around the class name, they are easily overlooked)

提交回复
热议问题