Reputation: 1
Any ideal about preloading images in Angular with best practice. With 'Slow Internet Connection' When I load my component I see all texts and only after 2 sec I see my images. How can I improve this user experience ?
Upvotes: 0
Views: 2176
Reputation: 1225
There are many techniques for optimizing FCP/LCP, you can read about some and the new NgOptimizedImage - new v14.2 feature: https://developer.chrome.com/blog/angular-image-directive/
Also general advice on lazy loading, which is probably smarter than preloading: https://web.dev/lazy-loading-images/ (not Angular specific)
If you really need to preload, check out this thread: Preloading images with JavaScript
Upvotes: 1