我有一个JSON数据集在角度说angularJs单柱过滤基于复选框选择
$scope.data = [{
call_id: '1',
title: 'test',
start: new Date(elem.call_date),
backgroundColor: "#9f1eab",
borderColor: "#9f1eab",
filterByCheckbox: 'filterOne'},
{
call_id: '1',
title: 'test',
start: new Date(elem.call_date),
backgroundColor: "#9f1eab",
borderColor: "#9f1eab",
filterByCheckbox: 'filterTwo'
}];
不同值现在我有3 checkox
filterOne
filterTwo
filterThree
现在我想基于过滤$scope.data
超过3个复选框选择。 列$scope.data
过滤是filterByCheckbox
所以上面是包含具有列filterByCheckbox
我想筛选基于该列中的数据记录列表我的数据集。
如果选中前2个复选框,则应在filterByCheckbox
列上过滤$scope.data
,其中包含filterOne
和filterTwo
值。
我如何在angularjs中实现这一点?
我曾尝试:
$filter('filter')($scope.data, { filterByCheckbox: 'filterTwo' })
但它适用于只有一个复选框。
你需要共享你的代码'$ scope.data'和你到目前为止 – tanmay
我已经更新了我的问题做了什么。 –
[如何在angularJS中过滤多个值(OR操作)]可能的重复(http://stackoverflow.com/questions/15868248/how-to-filter-multiple-values-or-operation-in-angularjs) – Martin