Ion-img and domsanitizer

Hello, I’ve problem with ion-img and domsanitizer. When I import dom sanitizer, it will cause some problem like some link is broken in the middle and can’t be load event by sanitizer it self. Any Ideas how to fix it? Thanks

Probably a stupid question, but you are doing this in conjunction with virtual scroll, right? That’s the only context in which you should be using <ion-img>.

What’s virtual scroll? I use it on container.

I hope it’s not stupid, because it’s not loading, event I use a model and use one way binding, the string is cut and lost half of the string, like being substring-ed…

Then forget that <ion-img> exists. Use an ordinary <img> instead.

Errr… why, Is there any explanation? I can’t see it on the ionic documentation.

Note: ion-img is only meant to be used inside of virtual-scroll.

1 Like

2 years later, ion-img doesn’t require virtual scroll. But from my experience it works differently in different browsers. Also try the work around mentioned here