JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp" ng-controller="check">
<div class = "container">
<table border=1 width ="100%">
<tr ng-repeat="user in users">
<td><p ng-show ="user.myVar">CHECK</p>{{user.id}}</td>
<td>{{user.name}}</td>
<td>{{user.stat}}</td>
<td><button id ="btn" ng-click = "toggleShow(user,$index)">show check</button></td>
</tr>
</table>
</div>
</div>
JavaScript
var app = angular.module("myApp", []);
app.controller('check', function ($scope) {
$scope.toggleShow = function(user,$index){
for(var i=0;i<$scope.users.length;i++){
$scope.users[i].myVar='false'
}
$scope.users[$index].myVar='true'
};
$scope.users = [
{
id:1,
name:'Mary Land',
stat:51,
myVar:'false'
},
{
id:2,
name:'Kenhie Land',
stat:51,
myVar:'false'
},
{
id:3,
name:'Mary Land',
stat:51,
myVar:'false'
},
{
id:4,
name:'Kenhie Land',
stat:51,
myVar:'false'
},
{
id:5,
name:'Mary Land',
stat:51,
myVar:'false'
},
{
id:6,
name:'Kenhie Land',
stat:51,
myVar:'false'
},
{
id:7,
name:'Mary Land',
stat:51,
myVar:'false'
},
{
id:8,
name:'Kenhie Land',
stat:51,
myVar:'false'
},
{
id:9,
name:'Mary Land',
stat:51,
myVar:'false'
},
];
});