基于json的离子角度造型

时间:2016-05-02 02:13:11

标签: css angularjs json cordova ionic-framework

我试图更改项目颜色。 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>

2 个答案:

答案 0 :(得分:0)

ng-class =&#34; {&#39; red&#39; :table.status === 0}&#34;

请尝试分享您的观察

答案 1 :(得分:0)

你必须这样做,就像在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>