【发布时间】:2014-09-15 14:09:20
【问题描述】:
我有一个测试 Todo 应用程序的 json 响应,所以我可以在这里学习 AngularJS,这是 Json 响应:
{"id":"1","text":"Et aut optio et enim necessitatibus magni voluptatem.","due_date":"1970-08-04 00:00:00","priority":"2","created_at":"2014-09-15 01:26:52","updated_at":"2014-09-15 01:26:52"}
然后我对所有响应进行角度循环并创建待办事项表:
<table class="table table-striped table-condensed table-hover">
<thead>
<th>Todo</th>
<th>Priority</th>
<th>Due Date</th>
</thead>
<tbody>
<tr ng-repeat="todo in todos">
<td>{{ todo.text }}</td>
<td>{{ todo.priority }}</td>
<td>{{todo.due_date | date:mediumDate}}</td>
</tr>
</tbody>
</table>
一切正常,除了 date:mediumDate 过滤表中的日期仍然显示时间戳样式而不是过滤格式。什么可能导致它失败?
【问题讨论】: