【发布时间】:2015-09-13 23:33:50
【问题描述】:
我有一些使用角度和数据表显示的数据。现在我希望这些数据按日期排序。我的代码如下所示。
<table dataTable="ng"
class="table table-striped table-bordered hover"
dt-options="dtOptions">
<thead>
<tr >
<th>Date/Time</th>
<th>Created By</th>
...
</tr>
</thead>
<tbody>
<tr ng-repeat="x in items | orderBy : 'timestamp' : true">
<td>{{x.timestamp | date: 'medium'}}</td>
<td>{{x.user.firstname}} {{x.user.lastname}}</td>
...
</tr>
</tbody>
</table>
但是,我似乎只能格式化日期或对其进行排序,但不能同时进行。如果我删除它排序的格式,否则它不会。
有人知道我做错了什么吗?
【问题讨论】:
标签: angularjs