Angular · Senior · Question 28 of 75
What does the priority attribute do with NgOptimizedImage?
<img ngSrc="hero.jpg" width="1200" height="600" priority />- ✓Correct answer: Marks the LCP image: loads it eagerly with high fetch priority (and a preload hint in SSR)
- 2Makes the image lazy-loaded
- 3Converts the image to WebP on the fly
Explanation
ngSrc images are lazy by default, which is wrong for the hero image. The directive also requires width/height (or fill) to prevent layout shifts and can generate srcset via a loader.