我有一個angularjs中繼器。每次在中繼器中更改時顯示一個值
<tbody data-ng-repeat="game in model.Games | unique:'Number'">
<tr><td colspan="3">{{game.Location}}</td></tr>
<tr>
<td>{{game.Number}}</td>
<td>{{game.Away}}</td>
<td>{{game.Home}}</td>
</tr>
</tbody>
在game
有一個屬性Location
都將保持不變,然後在某個時刻發生變化,例如:
[
{ Number: 1, Location: 'Place 1', Home: 'Team 1', Away: 'Team 2' },
{ Number: 1, Location: 'Place 1', Home: 'Team 3', Away: 'Team 4' },
{ Number: 2, Location: 'Place 1', Home: 'Team 1', Away: 'Team 2' },
{ Number: 2, Location: 'Place 1', Home: 'Team 3', Away: 'Team 4' },
{ Number: 3, Location: 'Place 2', Home: 'Team 1', Away: 'Team 2' },
{ Number: 3, Location: 'Place 2', Home: 'Team 3', Away: 'Team 4' },
{ Number: 4, Location: 'Place 2', Home: 'Team 1', Away: 'Team 2' },
{ Number: 4, Location: 'Place 2', Home: 'Team 3', Away: 'Team 4' }
]
每次它改變我想要顯示它的價值的時候,而不是顯示它的時候它重複着。