You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
I have an Angular component which contains a Loading spinner.
The spinner is toggled by a BehaviorSubject called loading$, which starts off as true, and is switched to false once the data is loaded from the service.
I noticed that if the service responds too quickly (if the data was previously loaded and cached,) then the loading spinner will not be removed from the template (even after the data is loaded and shows up in the template).
If I add even a small delay when loading the data, then the spinner will be removed as expected.
This is an ExpressionChangedAfterItHasBeenChecked scenario, where loaded$ emits during a change detection cycle and its prior value has already been observed in the template. It isn't reported as error due to using OnPush, please see #45612.
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
I have an Angular component which contains a Loading spinner.
The spinner is toggled by a BehaviorSubject called loading$, which starts off as true, and is switched to false once the data is loaded from the service.
I noticed that if the service responds too quickly (if the data was previously loaded and cached,) then the loading spinner will not be removed from the template (even after the data is loaded and shows up in the template).
If I add even a small delay when loading the data, then the spinner will be removed as expected.
Here is an example with the bug:
https://stackblitz.com/edit/stackblitz-starters-kwjwgf?file=src%2Fmain.ts
Here is an example where a 1ms delay fixes the bug:
https://stackblitz.com/edit/stackblitz-starters-y1pt4w?file=src%2Fmain.ts
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-kwjwgf?file=src%2Fmain.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: