It would seem considerably cleaner and simpler to me to just set item.picture
to the placeholder URL at the time item
is born, and swap it out once the actual image is available. The template needs no modification at all in this scenario.
This is a bad habit. Once you start dealing with DomSanitizer
, you will bang your head into this.