AngularJS表中的反向排序顺序

时间:2017-11-13 16:08:14

标签: javascript angularjs

如何根据单一类型(即年龄)反转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中搜索。

0 个答案:

没有答案