我正在使用此链接中的复选框过滤器。它工作正常,但如何更改它以选择多个复选框。现在只适用于1个复选框。
http://jsfiddle.net/HWa2m/243/
<input type="checkbox" data-ng-model="useBrands[brand]" />
{{brand}} <span>({{ (filteredProducts | filter:searchTerm | filter:count('Brand', brand)).length }})</span> </label>
答案 0 :(得分:0)
更改
<div data-ng-repeat="brand in brandsGroup | limitTo: maxBrands" data-ng-if="(filteredProducts | filter:searchTerm | filter:count('Brand', brand)).length > 0">
到
<div data-ng-repeat="brand in brandsGroup | limitTo: maxBrands" >
和
{{brand}} <span>({{ (filteredProducts | filter:searchTerm | filter:count('Brand', brand)).length }})</span>
要
{{brand}} <span>({{ (products | filter:searchTerm | filter:count('Brand', brand)).length }})</span>