1列のdatetimeにng-tableを表示する必要があります:
var renderGrid = function(tableData) {
$scope.tableData = tableData;
if($scope.tableParams) {
$scope.tableParams.reload();
} else {
$scope.tableParams = new ngTableParams({
page: 1,
count: 10,
sorting: {
date: 'asc'
},
filter: {
date: ''
}
}, {
getData: function($defer, params) {
var sliceStart = (params.page() - 1) * params.count();
var sliceEnd = params.page() * params.count();
var orderedData = params.filter() ? $filter('filter')($scope.tableData, params.filter()) : $scope.tableData;
var filteredData = params.sorting() ? $filter('orderBy')(orderedData, params.orderBy()) : $scope.tableData;
$scope.totalCount = filteredData.length;
params.total(filteredData.length);
$defer.resolve(filteredData.slice(sliceStart, sliceEnd));
}
});
}
};
<table ng-table="tableParams" template-pagination="tcTableNav" class="tcTable">
<tr ng-repeat="item in $data">
<td style="width:34%" sortable="'date'" data-title="'Date'"><div>{{item.date}}</div></td>
<td style="width:33%" sortable="'autor'" data-title="'Autor'"><div>{{item.autor}}</div></td>
<td style="width:33%" sortable="'article'" data-title="'Article'"><div>{{item.article}}</div></td>
</tr>
</table>
ソート+フィルタリングが正しく機能するように、datetimeを正しく形成するにはどうすればよいですか?