How can I apply style on some item in a list that satisfy listed condition:
7条回答 灰色年华 (楼主) 2021-01-11 10:13 On Angular >9 the syntax is following: [ngStyle]="{'background-color': item.selected ? '#f00' : ''}" Make sure you do not add a semicolon (;) at the end of the style expression as this breaks the functionality 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
On Angular >9 the syntax is following:
[ngStyle]="{'background-color': item.selected ? '#f00' : ''}"
Make sure you do not add a semicolon (;) at the end of the style expression as this breaks the functionality