I am currently facing an issue with displaying "No Results Found" when a user utilizes my search feature. The current problem is that "No Results Found" appears immediately on the screen and then disappears while a search query is being processed, only to reappear if no results are found. Ideally, I would like "No Results Found" to display only after a search query has been triggered and evaluated. Is there a more effective way to achieve this rather than using a timeout method? Below is the function code I have implemented:
public get noResultsFound(): boolean
{
if (this.query && !this._isSearching && !this.hasResults) {
return true;
}
}
Below is how I have structured my view code:
<div *ngIf="inputHasFocus && noResultsFound" class="no-results-found">No Results Found</div>