JSON
に文字列の値に対応するボタンを表示する必要があります。 ng-show
を使用しようとしましたが、私のサイトのすべてのボタンが表示されます。イオンテンプレートでng-showを使用する
<ion-col ng-show="channels.fields.status == 'on'" col-sm-1 class="verse">
<button ion-button color="secondary" class="big_on"> On </button>
</ion-col>
<ion-col ng-show="channels.fields.status == 'off'" col-sm-1 class="verse">
<button ion-button color="light" class="big_off"> Off </button>
</ion-col>
<ion-col ng-show="channels.fields.status == 'error'" col-sm-1 class="verse">
<button ion-button color="danger" class="big_error"> Error </button>
</ion-col>
同じ:///// – Unkown123
$ scope.channelsオブジェクトを共有します。 – Santhoshkumar