I have been going over a lot of tutorials on how to filter a list and can\'t find an example for my simple use-case.
I have several buttons such as
&
My response is very similar to Caio's. I just wanted to show how to filter out an existing array.
In my ng-repeat I have a search filter that goes through the words. I wanted tabs to look for a string match. So I added a additional filter
[[drink.name]]
I only have the top part of my table but this should show the strategy. The second filter called myFilter is attached to the buttons below.
On each button I am able to add a ng-click that goes through myFilter and searches the td with drink.name. In each ng-click I can set the value of name to search. So every title containing soda or energy can be filtered through.
- 热议问题