Currently, I am working on a project where I have a table displaying elements using ng-repeat. My goal is to implement dynamic filters that can be added through tags using ng-tags-input plugin. These tags will serve as the filter criteria for the table data.
You can check out the plunk I have created to see the setup. I need assistance in utilizing these tag entries to create dynamic filters.
I attempted applying a single element filter like this:
<body ng-controller="MainCtrl">
<tags-input ng-model="tags"></tags-input>
<p>Model: {{tags}}</p>
<table border=1 cellpadding=10px>
<tr ng-repeat = "t in tableData | filter:tags[0].text">
<td>{{t.data1}}</td>
<td>{{t.data2}}</td>
</tr>
</table>
</body>
However, this method only allows filtering based on a single tag entry. Is there a way to apply all tag entries as filters?
I have come across solutions on SO that utilize filters in this format:
<tr ng-repeat = "t in tableData | filter:{data1:someFilteData}">
Check out one of the examples here: fiddle. Unfortunately, I'm having difficulties implementing filters from a JSON Array. Any suggestions on how to achieve this?