<ul ng-repeat="x in data | orderBy:'-time'">
     <li>姓名:{{x.name}},时间:{{x.time}}</li>
 </ul>
<script>
    var app = angular.module("myApp", []);
    app.controller('Controller', function ($scope) {
        $scope.data=[{name:'ad',id:'01',time:'2017-4-06'},
                  {name:'zx',id:'02',time:'2017-4-05'},
                 {name:'lu',id:'02',time:'2017-5-17'}
        ]
    })
</script>

  按时间降序排。在字段名前加个“-”号即可。(个人觉得这个方法比较好)

 

方法二:

<ul ng-repeat="x in data | orderBy:x.time:'desc'">
<li>姓名:{{x.name}},时间:{{x.time}}</li>
</ul>
这个在百度上查到的,但有点问题,感觉不是很好,但有时候也是一种方法

相关文章:

  • 2021-09-23
  • 2021-07-11
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-10-28
  • 2022-12-23
  • 2021-08-06
  • 2021-12-01
相关资源
相似解决方案