I have a text box with a keyup
event assigned to it for a search function. However, I want the search function to happen after a delay instead of triggering on every key press.
Here is the HTML code:
<input type="text" [(ngModel)]="searchedKPI" (keyup)="searchConfigTree()">
And here is the TypeScript code:
list = list.filter(item => item.label.toLocaleLowerCase().includes(this.searchedKPI.toLocaleLowerCase())).slice();
Right now, when searching for the string "text," the event triggers 4 times. I only want it to trigger once for the "text" string:
https://i.sstatic.net/lRflt.jpg
Any solutions?