Angular 7.2.13
When navigating with the browser back button, the HTML of the component is loaded, but the component css/js is not loaded, and the page hangs.
However loading works fine when navigated by a link click or router.navigateByUrl() or if the page is reloaded. But never when navigating with the forward/back button.
I'm getting no console errors.
It works perfectly on the development server http://localhost:4200/. This issue occurs only in production.
UPDATE
This is happening in a child route.
UPDATE 2
Can't replicate the issue in a stackblitz with the same route structure. https://angular-tpsr5z.stackblitz.io/.
UPDATE 3
After hanging like this the component will immediately load if I click anything that fires a component method, or changes a property of the component.
from Why is Angular component not loading on browser back/forward navigation?
No comments:
Post a Comment