如何按某些数组对ng-repeat进行排序?

时间:2017-03-10 10:19:51

标签: javascript angularjs angularjs-ng-repeat

我有以下内容:

$scope.filterObj = {"status":["active"],"categories":["u"]}

我需要排序的对象:

{"categories" : ["u", "a"], "status" : "active"}

我试图将其过滤为:

<tr ng-repeat="item in filtered = (projects | filter:filterObj.status:item.status) | orderBy : 'created_at'">

此示例适用于一个项目:

<tr ng-repeat="item in filtered = (projects | filter:{ status : 'finished' }) | orderBy : 'created_at'">

但不是数组

0 个答案:

没有答案
相关问题