add AND filter functionality
parent
2daefe0e6c
commit
a18bedbc48
|
@ -96,8 +96,16 @@ export class StatisticHighScoreComponent {
|
|||
}
|
||||
|
||||
private filterPlayerAttribute(attribute) {
|
||||
const query = this.searchTerm.value.toLowerCase();
|
||||
return this.playersStored[attribute].filter(p => p.name.toLowerCase().includes(query))
|
||||
const query = this.searchTerm.value.toLowerCase().split('&');
|
||||
|
||||
return this.playersStored[attribute].filter(player => {
|
||||
for (let i = 0; i < query.length; i++) {
|
||||
if (player.name.toLowerCase().includes(query[i].trim())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue