In my Angular application, I implemented a loading-spinner component that I placed in the app component next to the router-outlet using *ngIf="isLoading". This allows me to have the loading spinner visible from every part of the application.
The 'isLoading' boolean is updated globally through ngrx's Store.
However, I encountered an error:
Error: ExpressionChangedAfterItHasBeenCheckedError: The expression has changed after it was checked. Previous value: 'ngIf: true'. Current value: 'ngIf: false'
After researching this error, I found out that one should not change parameter values from deeper child components.
So, how can I create a loading-spinner without duplicating the code in my app and without causing a change detection error?