我想做一个自举按钮,但我面临一些问题。切换按钮不是仅查看复选框显示,当我删除ngRepeat
指令,然后它只适用于单个按钮,但我需要使用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/ –