How to use debounce time for searching data in API's for keyup input change event. Give a look at the following code. It is not working. A search request to API is made on every input change. I want to make a search request to API using some denounce time.
Thank you in advance
.html
<input matInput (keyup) ="Onsearchinput($event.target.value)">
.ts
Onsearchinput(value){
debounceTime(500)
console.log(value)
this.productService.search_Products(value).subscribe(data => {
if(data){
console.log(data)
this.product_list = data
}
})
}