如何根据单一类型(即年龄)反转test2
?
$scope.test2=[{name:"abc",age:"10",gender:"m"},{name:"cde",age:"5",gender:"f"},{name:"efg",age:"25",gender:"m"},{name:"ghi",age:"15",gender:"f"}]
// sort table by gender.
$scope.test= $scope.test2.reverse();
例如,如果我想按年龄排序,那么我想根据该类型反转整个数组。
$scope.test2=[{name:"cde",age:"5",gender:"f"},{name:"abc",age:"10",gender:"m"},{name:"ghi",age:"15",gender:"f"}{name:"efg",age:"25",gender:"m"},].
因为我正在使用uib-pagination并在每个col中搜索。