我正在尝试类似的东西
<ion-item class="item-icon-right " ng-repeat="project in jsonObj.Projects | filter:projectArea:true:ProjectStatus" type="item-text-wrap" ui-sref="tabs.detail({project:project['Project name']})">
<div class="row">
<div class="col col-45">
<h2>{{project["Project name"]}}</h2>
<h4>{{project["PM"]}}</h4>
</div>
<div class="col col-45"></div>
<div class="col col-10">
<span class="badge badge-assertive icon-badge"><i class="ion-ios-arrow-right"></i></span>
</div>
</div>
</ion-item>
控制器:
angular.module('App')
.controller('ProjectsController', function ($scope, $rootScope, $stateParams, $state) {
$scope.projectArea = $stateParams.area;
$scope.ProjectStatus = $stateParams.Project_Status;
});
数据:
{PM: "Oommen", Area: "Foods", Project name: "PLuM", Reviewer: "Alex", A&D Start Date: "7-Dec-15"…}$$hashKey: "object:31"A&D End Date: "15-Jan-16"A&D Start Date: "7-Dec-15"Area: "Foods"Build End Date: "TBD"Build Start Date: "TBD"Implementation date: "TBD"PM: "Oommen"Project Status: "Green"Project name: "PLuM"Reviewer: "Alex"SIT End Date: "TBD"SIT Start Date: "TBD"ST End Date: "TBD"ST Start Date: "TBD"Status: "HLD Phase Kickoff. Review to be planned early"}
我正在尝试使用“区域”和“项目状态”值过滤ng-repeat.但是它仅根据区域进行过滤.你能帮助找出问题吗?
最佳答案 你可以 chain filters:
project in jsonObj.Projects | filter:projectArea:true | filter:ProjectStatus