компонент
this.IsLoading = true;
this.httpClient.get(url,{responseType: 'json'}).subscribe(
(data: any) => {
this.data = res.records;
console.log(res);
},
error => { },
() => (this.IsLoading = false)
);
}
HTML-файл
<div class="content" [appSpinner]="IsLoading">
/*show content*/
</div>
и добавьте spinner
как directive
ИЛИ, если вы не хотите использовать директиву, вы можете просто использовать
<div class="content" *ngIf="IsLoading">
/***/
</div>