请看这个 JSFiddlehttp://jsfiddle.net/luke88jones/MfLqa/2/ http://jsfiddle.net/luke88jones/MfLqa/2/
<div ng-repeat="booking in testBookings | orderBy: 'booking.sortDate'">
<span>{{booking.bookingDateTime | date:'dd-MMM-yy HH:mm'}}</span>
</div>
我正在尝试使用 orderBy 对 ng-repeat 进行排序。我们的数据目前使用 bookingDateTime 作为过滤器,但该过滤器不起作用。我不确定 Angular 是否无法解析该函数,因此将 sortDate 属性作为 ISO 字符串放入,并尝试使用它进行排序,但它似乎仍然不起作用。
有任何想法吗?
试试这个:
<div ng-repeat="booking in testBookings | orderBy:'sortDate'">
工作小提琴:http://jsfiddle.net/Bq7hb/ http://jsfiddle.net/Bq7hb/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)