我認爲在角度上使用orderby過濾器,我們可以簡單地通過在您要排序的那個之前添加「 - 」來反轉。所以在我的情況下,下面的代碼,爲什麼這不起作用?我已經嘗試過用「 - 」進出單引號。按降序進行角度排序
代碼:
<tr class="alertText" ng-repeat="swipe in ppt.Swipes | orderBy:'-swipe.date' ">
<td>{{swipe.date|date : 'MM/dd/yyyy'}}</td>
<td>{{swipe.descr}}</td>
<td>{{swipe.amount | currency}}</td>
<td>{{swipe.dueDate|date : 'MM/dd/yyyy'}}</td>
<td>{{swipe.status}}</td>
<td class="clearIcon"><span ng-click="editSwipe()"><img src="ppt/assets/toolIcons/clearswipe-small.svg"></span></td>
</tr>