I'm using a dataSource to store all my data. Until now, I was using the standard filter when performing a search. However, now I would like to perform searchs with the "OR" operator.
Example :
{name : john, age : 25, work : driver}
{name : peter, age : 28, work : writer}
{name : james, age : 39, work : athlete}
If I input "john james" I want the filter function to get me line 1 AND line 3.
I'm pretty sure we have to use a filterPredicate, but I really don't understand how to create/use those, and I couldn't find any decent/working example
The documentation would not help much besides giving me a protoype :
filterPredicate: ((data: T, filter: string) => boolean);
Do you guys have any idea or code example how to achieve that ?
Here is what my function looks like for now for a basic search :
applyFilter(filterValue: string) {
filterValue = filterValue.toLowerCase();
this.dataSource.filter = filterValue;
}