I successfully implemented server-side pagination in the Angular6 material data grid following the instructions from this link.
Now, I am facing an issue where I want to display a "No Data Found" message if the response dataset is empty. I tried using ngIf with the totalCount variable, which is an Observable, but it doesn't seem to work as expected.
private totalCountSubject = new BehaviorSubject([]);
public totalCount$ = this.totalCountSubject.asObservable();
this.totalCountSubject.next([body.data.count]);
// View
{{dataSource.totalCount$}} <!-- This displays either 0 or the count of rows -->
<!-- This ngIf block does not work as intended. --->
<span *ngIf="(dataSource.totalCount$ | async) === 0 ">
NO DATA FOUND!!!!
</span>
Does anyone have any insight into why ngIf is not functioning properly in this scenario?