Reputation: 1907
I'm using checkboxes to filter a resultset from a json file. It's working fine, but I would like to have the count (from the filtered resultset only) appearing next to each filter. I've tried a few ways to do this but I can only end up getting the length of the result itself or the json output.
I have a plunk
( {{ data.list|filter:itemFilter[option.name].count }} )
Another plunk
Any help is appreciated.
Jimi
Upvotes: 0
Views: 502
Reputation: 13071
You can do it like this:
{{ ((data.list | filter:itemFilter)|filter:option.name).length }}
Upvotes: 1