I have mi in place an http request spinner that appears if a request is in progress. Except that I get the following error :
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.
<div class="container-fluid">
<div class="row col-md-12">
<div class="spinner-style" *ngIf="isLoading | async">
<mat-spinner spinner-delay="2000"></mat-spinner>
</div>
<app-another-comp-table[isLoading]="isLoading | async">
.....
</app-another-comp-table>
</div>
</div>
My method init in my component :
ngOnInit(){
this.isLoading = this.loaderService.getIsLoading$();
...
}
My Loader service :
export class LoaderService {
public isLoading = new BehaviorSubject(false);
constructor() { }
getIsLoading$(): Observable<boolean> {
return this.isLoading.asObservable();
}
}
isLoading. My guess is that you are executing a code inAfterViewInit...