我有一个数据列表说
$scope.data = [
{"id":34,"buyername":"kamaldeep282","status":"NOTRELEASED","statusMessage":"Update Feedback","paymentMethod":"Cash"},
{"id":43,"buyername":"kamaldeep282","status":"RELEASED","statusMessage":"Update Feedback","paymentMethod":"Cash"},
{"id":44,"buyername":"kdsingh1002","status":"RELEASED","statusMessage":"Update Feedback","paymentMethod":"Cash"},
{"id":50,"buyername":"kdsingh1002","status":"RELEASED","statusMessage":"Update Feedback","paymentMethod":"Cash"},
{"id":55,"buyername":"kamaldeep282","status":"DISPUTE","statusMessage":"Dispute Raised","paymentMethod":"Cash"}
];
现在我在HTML中应用了一个过滤器: -
<input type="text" ng-model="querytx" ng-change="filterData()">
并在控制器中将filterData()定义为: -
$scope.filterData = function() {
$scope.finalData = $filter("filter")($scope.data, { id:$scope.querytx, buyername:$scope.querytx, status:$scope.querytx});
};
现在$scope.finalData
中的filterData返回的是id, buyername
的AND和状态。 <{1}}中有iff $scope.querytx
,只返回该行。
我想要的是ID,买方名称和状态,或者如果{,1}}在id,buyername和status中都有,那么应该返回该行。
注意:
id, buyername and status,
中执行此类操作
在我正在使用的链接https://stackoverflow.com/a/20850929/4948805中
角度表中的$scope.querytx
自动重复。