我有一個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