Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller='indexCtrl'>
<table>
  <tr ng-repeat='i in test' ng-click='changeShow($index)'>
    <td>{{i.name}}</td>
    <td>{{$index}}</td>
    <td ng-show='num == $index'>{{i.sex}}</td>
  </tr>
</table>
</body>
</html>
 
var indexCtrl = ['$scope', function($scope){
  $scope.num = 0;
  $scope.test = [
    {
    name:'simple',
    sex:'f'
    },
    {
    name:'simple1',
    sex:'f'
    },
    {
    name:'simple2',
    sex:'f'
    },
    {
    name:'simple3',
    sex:'f'
    },
    {
    name:'simple4',
    sex:'f'
    },
    {
    name:'simple5',
    sex:'f'
    },
    {
    name:'simple6',
    sex:'f'
    },
    {
    name:'simple7',
    sex:'f'
    }];
  $scope.changeShow = function(index){
    $scope.num = index;
  };
}];
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers