[2015-10-28]表格排序----question

angularjs代码上

tr
th(ng-click="sort('date')") 日期

tr(ng-repeat="item in item1 | orderBy:orderProp")
td {{item.date}}

#排序
$scope.sort=(i)->
if $scope.orderProp is i
$scope.orderProp="-"+i
else
$scope.orderProp=i

这种方法排序,刚加载页面完成后 (无做任何点击操作),可以看到显示的表格数据和从后台获取来的数据排序的位置不一致?
代码中没有用: | orderBy:orderProp的话,跟后台是一致的。这边后台数据格式都是 对象格式

原文地址:https://www.cnblogs.com/rysly/p/tablesort.html