【发布时间】:2014-03-24 18:01:17
【问题描述】:
我有一个对象,它有一个名为changeColor 的变量。在我的 html 表格中,如果 changeColor 为真,我想更改单元格颜色。我正在使用角度。
<tr ng-repeat="list in results">
<% if (!{{list.changeColor}} ) %>
<% { %>
<td bgcolor="red">{{list.value}}</td>
<% } %>
<td>{{list.price}}</td>
但经过测试它总是红色的,<% if (! ) %> <% { %> <% } %> 写在我的 html 页面中!你能帮帮我吗?
测试过这个
<td style=".red {bgcolor: red;} .black {bgcolor: black;}"
ng-class='{red : list.changeColor, black: !list.changeColor}'>
{{list.price}}</td>
但它不起作用
【问题讨论】:
标签: html angularjs html-table background-color