How can i get ids of selected checkbox using angularjs? i have a table fetched using angularjs. but dont know how i transfer ids of each row which i checked using checkbox.
$scope.deleteBulk = function($scope){
//what code should i use to get ids of checked row
}
<button ng-click="deleteBulk()">Delete</button>
<table class="table table-striped">
<thead>
<tr>
<th>select</th>
<th>Name</th>
<th>Gender</th>
<th>Email</th>
<th>Address</th>
<th>Phone</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
<tr ng-repeat="user in users | filter:searchUser">
<td><input type="checkbox" checklist-model="user.roles(user.id)" checklist-value="user.id"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<button class="btn btn-primary" ng-click="updateData(user.id, user.name, user.gender, user.email, user.address, user.phone)">Edit</button>
<button class="btn btn-danger" ng-click="deleteData(user.id)">Delete</button>
</td>
</tr>
</table>
I'm clueless. Sorry for bad English,
Aucun commentaire:
Enregistrer un commentaire