Angular · Senior · Question 28 of 75

What does the priority attribute do with NgOptimizedImage?

<img ngSrc="hero.jpg" width="1200" height="600" priority />

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.

Further reading

Problem with a question

Angular · Senior · question 28

Test yourself

Take the Angular · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz