I am using the example Table with filtering
from Angular Material's site https://material.angular.io/components/table/examples
I want to let users search using wildcards. In this case, a %
I wrote the following:
const filterValue = (event.target as HTMLInputElement).value;
let filterArray = filterValue.trim().toLowerCase().split("%");
for (let fil of filterArray) {
//I know this line below won't work, as it will just replace the filter with each iteration, but showing for sake of example
this.tableData.filter = fil;
}
So if the user types one%two
in the input field, I would want the filter to find table rows where both the words "one" AND "two" exist somewhere in the row.
I have tried several variations of code, but nothing seems to work quite right. Any ideas on how to make this work?