【发布时间】:2015-09-20 03:30:52
【问题描述】:
大家好,我有一个 ul 的 ng-repeat,为每个项目制作 li。
在 json 中,如果不匹配这样的预定义字符串,我想突出显示一个值:
ng-style="{'background-color':(json.string!=='NO_MATCH'?'yellow')}
这是完整的 ng-repeat
<li ng-repeat="json in json" ng-style="{'background-color':(json.string!=='NO_MATCH'?'yellow')}>{{ json.title }} - {{ json.display }}</li>
谁能告诉我这里哪里出错了?
【问题讨论】:
-
我的一个想法是数组“json.string”中的项目不显示这有关系吗?
-
ng-style="{'background-color: yellow;': json.string!=='NO_MATCH'}"
-
ng-style="{'background-color: yellow;': json.string!=='NO_MATCH'}"
-
@MatthewBrianSheets 你能出示你的
controller吗?
标签: javascript css json angularjs