admin管理员组文章数量:1334895
Please see this JSFiddle /
<div ng-repeat="booking in testBookings | orderBy: 'booking.sortDate'">
<span>{{booking.bookingDateTime | date:'dd-MMM-yy HH:mm'}}</span>
</div>
I am trying to use the orderBy to sort a ng-repeat. Our data currently uses the bookingDateTime for the filter which isn't working. I wasn't sure if angular wasn't resolving the function so have put in the sortDate property as an ISO string and tried to sort using this but still it doesn't seem to be working.
Any ideas?
Please see this JSFiddle http://jsfiddle/luke88jones/MfLqa/2/
<div ng-repeat="booking in testBookings | orderBy: 'booking.sortDate'">
<span>{{booking.bookingDateTime | date:'dd-MMM-yy HH:mm'}}</span>
</div>
I am trying to use the orderBy to sort a ng-repeat. Our data currently uses the bookingDateTime for the filter which isn't working. I wasn't sure if angular wasn't resolving the function so have put in the sortDate property as an ISO string and tried to sort using this but still it doesn't seem to be working.
Any ideas?
Share asked Mar 19, 2014 at 11:07 luke88jonesluke88jones 1331 silver badge5 bronze badges1 Answer
Reset to default 6Try this instead:
<div ng-repeat="booking in testBookings | orderBy:'sortDate'">
working fiddle : http://jsfiddle/Bq7hb/
本文标签: javascriptAngularJS ngRepeat orderBy not working with DateTime stringStack Overflow
版权声明:本文标题:javascript - AngularJS ngRepeat orderBy not working with DateTime string - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742292831a2448133.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论