I found inspiration in the Table with filtering
example on Angular Material's website, which can be accessed at https://material.angular.io/components/table/examples
My goal is to enable users to search using wildcards. For instance, I want to use a %
as a wildcard character.
This is what I came up with:
const filterValue = (event.target as HTMLInputElement).value;
let filterArray = filterValue.trim().toLowerCase().split("%");
for (let fil of filterArray) {
//Although I understand that this line below won't work, since it will simply replace the filter with each iteration, I include it here for demonstration purposes
this.tableData.filter = fil;
}
Therefore, if the user inputs one%two
into the input field, I expect the filter to locate table rows where both "one" and "two" appear somewhere within the row.
I have experimented with various code iterations, but none seem to provide the desired outcome. Do you have any suggestions on how I can successfully implement this functionality?