blog/angular-defer-lazy-loading-total-guide #16
Replies: 4 comments 7 replies
-
|
What will be the user experience when we add lazy loading to Angular application, while the user is on the page if we push new version of the application. The Angular application will try to lazy load a component, but server will not have that file anymore because we published new version. |
Beta Was this translation helpful? Give feedback.
-
|
What about passing input values and handling events coming from lazy loaded component? |
Beta Was this translation helpful? Give feedback.
-
|
Great article! I'm currently trying to create a custom element via the @angular/elements package. The basic setup works fine but I've stumbled upon a pretty unfortunate stumbling block: The new @defer block does not work an custom element that is hosted under a different origin. The problem is that the lazy chunks are always loaded relative to the origin that hosts the custom element. For example:
As soon as a @defer block is triggered, the corresponding lazy chunk (e.g., 835.js) is requested via http://127.0.0.1/835.js - this obviously doesn't work, as the chunk is hosted on 8081, next to the main bundle. Specifying the baseHref option in the angular.json doesn't make a difference. Is there any way to make this scenario work? Or are lazy-loading and angular elements conceptually incompatible? |
Beta Was this translation helpful? Give feedback.
-
|
Hello. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
blog/angular-defer-lazy-loading-total-guide
Learn everything about the lazy loading of standalone components with Angular @defer block including best practices, deep dive on all interactions and gotchas including a live demo!
https://angularexperts.io/blog/angular-defer-lazy-loading-total-guide
Beta Was this translation helpful? Give feedback.
All reactions