I did a loading-spinner component in my Angular app. I placed it in the app component next to the router-outlet with *ngIf="isLoading" so i could make it visible from everywhere in the application.
'isLoading' boolean is being updated globally using ngrx's Store.
Now i've got an error saying
Error:ExpressionChangedAfterItHasBeenCheckedError: Expression had changed after it was checked. Previous value: 'ngIf: true'. Current value: 'ngIf: false'
I've been reading about this error and the conclusion was: Don't change parameter value from deeper child components.
So how can make a loading-spinner without duplicate the code in my app and without causing a change detection error?
ChangeDetectorRef
and calldetectChanges
– Hockey