I have components with loading bar, which shows and hides from boolean variable called isLoading
. For example:
ngOnInit() {
this.isLoading = true;
this.someService.getAll().subscribe(data => {
// some code...
this.isLoading = false;
});
}
<loading-bar *ngIf="isLoading"></loading-bar>
But I have a problem, when there are child components in the main component and the data loads from them. The loading bar should be in the main component and should be hide only when data from all child components arrive. What is the best way to achieve this.