私はブートストラップのトグルボタンを作りたいと思いますが、私はいくつかの問題に直面しています。トグルボタンは表示専用ではないチェックボックスが表示され、ngRepeat
指示文を削除すると、1つのボタンに対してのみ正常に機能しますが、ngRepeat
を使用すると複数のボタンが必要になります。親切に私を助けてください。角度ngrepeatのトグルボタン
<div class="box-body" ng-controller="AutomationController">
<div class="table-responsive">
<table class="table table-hover ">
<thead>
<tr>
<th>Device Name</th>
<th>Status</th>
<th>Action</th>
<th>Edit Device Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="device in devices">
<td>[[device.dname]]</td>
<td>
<span ng-if="device.status===1">ON</span>
<span ng-if="device.status===0">OFF</span>
</td>
<td>
<input type="checkbox" checked data-toggle="toggle" ng-if="device.status===1">
<input type="checkbox" checked data-toggle="toggle" ng-if="device.status===0">
</td>
<td><a href="#"><i class="fa fa-pencil-square-o"></i></a></td>
</tr>
</tbody>
</table>
</div>
</div>
おかげスレシュが、問題ではありません解決されました.. – user3220457
チェックjsfiddle私は上記の答えで作成しました –
答えでのフィドルチェックhttp://jsfiddle.net/sureshchahal/Lvc0u55v/2531/ –