user3781360
user3781360

Reputation: 25

Dynamic multiple checkbox filter in angular JS

I am using the checkbox filter from this link. It works fine but how to change it to select multiple checkbox's. Now it works for only 1 checkbox selection.

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>

Upvotes: 0

Views: 481

Answers (1)

Modar Na
Modar Na

Reputation: 918

Change

<div data-ng-repeat="brand in brandsGroup | limitTo: maxBrands" data-ng-if="(filteredProducts | filter:searchTerm | filter:count('Brand', brand)).length > 0">

To

<div data-ng-repeat="brand in brandsGroup | limitTo: maxBrands" >

And

{{brand}} <span>({{ (filteredProducts | filter:searchTerm | filter:count('Brand', brand)).length }})</span> 

To

{{brand}} <span>({{ (products | filter:searchTerm | filter:count('Brand', brand)).length }})</span> 

Upvotes: 1

Related Questions