0
我想使它成爲可能,以便通過點擊以下其中一個「客戶端」<td>
s我可以從'clients'數組中選擇特定對象並切換到新的視圖。我假設我想從ng-click開始,只是不知道該怎麼去做。另外我不會使用任何jQuery。在angularjs中選擇一個數組中的對象
<div ng-init="clients = [
{firstname:'Buster', lastname:'Bluth', tagid:'4134'},
{firstname:'John', lastname:'McClane', tagid:'9845'},
{firstname:'Mister', lastname:'Spock', tagid:'0905'}
]"></div>
<div>
<div>Clients</div>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>I-Number</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="client in clients">
<td>{{client.firstname}}</td>
<td>{{client.lastname}}</td>
<td>{{client.inumber}}</td>
</tr>
</tbody>
</table>
</div>