JSFiddle - React, Tailwind, and code Playground
by santhosh lanka
HTML
<div ng-app="MyApp" ng-controller="UsersCtrl">
<input type="checkbox"
ng-model="selectAll"
ng-click="checkAll()" />
<table class="table">
<tr>
<th>User ID</th>
<th>User Name</th>
<th>Select</th>
</tr>
<tr ng-repeat="user in users | filter:search">
<td>{{user.id}}</td>
<td>{{user.name}}</td>
<td>
<input type="checkbox" ng-click="usersetting(user)" ng-model="user.select">
</td>
<td><tt>{{user.select}}</tt></td>
</tr>
{{user.select}}
</table>
</div>
JavaScript
angular.module('MyApp', []).controller('UsersCtrl', function($scope, $http) {
$scope.users = [
{id:1, name:'First'},
{id:2, name:'Second'},
{id:3, name:'Third'},
{id:4, name:'Fourth'},
{id:5, name:'Fifth'}
];
$scope.checkAll = function() {
angular.forEach($scope.users, function(user) {
user.select = $scope.selectAll;
console.log('---', user.name);
});
};
});