<img src=${imageUrlWebp} onerror="this.error=null;this.src=${imageUrl}" width="700" height="110"/>
Does this method of using fallback images in angular work in all the browsers.It seems to work in browser but not sure how to check in browsers which don't support webp. I know that they is another method something like this
<picture>
<source srcset="img/awesomeWebPImage.webp" type="image/webp">
<source srcset="img/creakyOldJPEG.jpg" type="image/jpeg">
<img src="img/creakyOldJPEG.jpg" alt="Alt Text!">
</picture>
But this doesn't seem to work properly as I am appending this snippet to html from a typescript file and always renders the src i give in img tag.
So can anyone tell if the first method is correct and any pointers on how to check if fallback is working properly in browsers which don't support webp