© m 尝试更改元素颜色。 Css 不工作或者我缺少其他东西?
<ion-view title="Add order to a table">
<ion-content class="has-header has-subheader">
<ion-list>
<ion-item ng-repeat="table in tables" type="item-text-wrap" class="item-avatar"
href="#/app/tables/{{table.id}}">
<div ng-class="{table.Status === '0': 'red'}">
{{table.Tablename}} - {{table.Status}}
<p ng-class="radio-high">dfsa</p>
</div>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
最佳答案
你必须按照 Stackhelpers 的回答那样做,但是 table.Status
必须大写,否则它将不起作用:
<ion-view title="Add order to a table">
<ion-content class="has-header has-subheader">
<ion-list>
<ion-item ng-repeat="table in tables" type="item-text-wrap" class="item-avatar" href="#/app/tables/{{table.id}}">
<div ng-class="{ 'red' : table.Status === 0 }">
{{table.Tablename}} - {{table.Status}}
<p ng-class="radio-high">dfsa</p>
</div>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
关于css - 基于 json 的 ionic Angular 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36974133/