真正的问题:
<div ng-repeat="x in shoppingList |orderBy:'+done'|filter:search track by $index" class="list-item" ng-class="{true: 'none-block', false: 'block'}[x.done&&hideMark]" style="padding-bottom:22px" >
<a href="#" ng-click="done(x)" ng-class="{true: 'strike', false: 'default'}[x.done]" style="display:block">
{{shoppingList.indexOf(x)}}.
<span class="thing" ng-bind="x.itemText"></span>
</a></div>
答案 0 :(得分:2)
应该是
ng-class="{true: 'none-block strike', false: 'block default'}[x.done]"
答案 1 :(得分:0)
ng-class="{'block default': !x[done], 'none-block strike': x[done]}"