ng-repeatが設定された表があります。行がクリックされると、ng-clickでオブジェクトに関連するデータを取得しています。テーブルにはjsonファイルが設定されています。選択した行がクリックされたときに、テーブルの他のすべての行を非表示にするにはどうすればよいですか?選択した値が設定されているときクリックした行以外のすべてのテーブル行を非表示にするAngularJS
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Age</th>
</tr>
</thead>
<tbody style="cursor: pointer" ng-cloak> <!--When the row is clicked, I want to hide all other rows except the clicked one.-->
<tr ng-repeat="person in people" ng-click="getSelected(person);">
<td>{{ person.firstName }}</td>
<td>{{ person.lastName }}</td>
<td>{{ person.age }}</td>
</tr>
</tbody>
</table>
<script>
angular.module("App", []).controller("MainController", function ($scope) {
$scope.people = peopleData;
$scope.getSelected = function (person) {
$scope.selected = person;
};
});
</script>
この質問は投票できませんか? – miken