0
我打电话给一个服务,它返回类似于这个对象的对象。 userCollections是正在存储的变量。智能表st-sort Angular JS - 排序不对象的对象
{
1: {
id: "A1",
name: "B1"
},
2: {
id: "A1",
name: "B1"
},
3: {
id: "A1",
name: "B1"
},
4: {
id: "A1",
name: "B1"
},
5: {
id: "A1",
name: "B1"
},
}
这就是我如何在表格中显示数据。
<table class="table table-hover" st-table="DisplayCollection" st-safe-src="userCollections">
<thead class="thead-inverse text-uppercase">
<tr>
<th st-sort="id" st-sort-default="true" class="cursor-pointer">Name</th>
<th st-sort="name" class="cursor-pointer">Email</th>
</tr>
</thead>
<tbody ng-repeat="(cname, cdata) in DisplayCollection">
<tr class="cursor-pointer" ng-repeat="collection in cdata">
<td ng-bind="collection.full_name | ellipsis:25:false"></td>
<td ng-bind="collection.email | ellipsis:25:false"></td>
</tr>
</tbody>
</table>
st-sort不起作用。我如何使它在对象的对象上工作。
我不能对象的对象转换为对象的数组,因为我需要一些操作的对象键。
任何方式来实现这种排序?