I want to show some html code based on response,but HTML render before receive response.
Html:
<div *ngIf="medias.length > 0">
some text
</div>
<div *ngIf="!medias.length > 0">
some other text
</div>
Ts:
ngOnInit(): void {
this.getMedias();
}
medias: Array<T> = [];
getMedias() {
this.controllerApiService
.getById()
.subscribe(data => {
this.medias = data
});
}
According to the code above firstly show "some other text" and after receive response,show "some text"
I trying to handle with skip() and skipWhile() but nothing change.