Open damirarh opened 1 year ago
Imported comment written by Qasim AlQari- Mubarmj on 2023-02-05T08:23:54
Thanks a lot it help me
Great idea, very useful :)
I have just one recommendation, since I needed to display the image again, if the src-attribute changes and the image could be displayed. Add the following Code in the directive and the image will be shown again, if the loading doesn't throw an error:
@HostListener('load') private onLoad() { this.el.nativeElement.style.display = 'initial'; }
Imported
URL: https://www.damirscorner.com/blog/posts/20210924-HandleMissingImagesInAngular.html