Is there any way show 'Loading' text until data fetch from api. As of now it is showing no data to display
I gone through the documentation did not found anything
Is there any way show 'Loading' text until data fetch from api. As of now it is showing no data to display
I gone through the documentation did not found anything
You can try something like below:
In .ts file:
isLoading = false;
doRequest() {
isLoading = true;
this.servis.doRequest()
.pipe(finalize(() -> this.isLoading = false))
.subscribe(data => {
// do smth
})
}
in .html
<div *ngIf="!isLoading; else loading">Your content</div>
<ng-template #loading>Loading...</ng-template>