M
M
Maxim2016-04-10 19:50:29
Angular
Maxim, 2016-04-10 19:50:29

How to make a filter using checkboxes in Angular?

There is json with objects, each object has a category parameter. The html page has checkboxes with these categories.
How to filter the output to only show objects that have one of the checked categories. With broadcast?
It only comes out like this:

<select ng-model="cat">
<option>...</option>
...
</select>

<div ng-repeat="product in products | filter:{category:cat}">
...
</div>

It turns out a sample of only one category without the possibility of multiple selection.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question