I'm trying to create a toggle button using Bootstrap, but I've run into some issues. The toggle button is not displaying correctly; it's showing as a checkbox instead. When I remove the ngRepeat
directive, the toggle button works fine for a single button, but I need it to work for multiple buttons using ngRepeat
. Can someone please assist me with this?
<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>