Hello,
In a part of my app, I have to get html content from web service and put it on the screen. The content come from the service usually contains p, img and h tags.
I did this part with [innerHTML] attribute. But when I want to use Image Viewer, it didn’t work.
I tried the package without innerHtml. It worked.
So how can I use Ionic Image Viewer with innerHtml?
I tried Pipe but it didn’t work for me.
Sample content:
<p>Title</p>
<img src="www.site.com/image.png" imageViewer />
Html file:
<ion-content padding>
<div [innerHTML]="content | safeHtml"></div>
</ion-content>
Typescript file:
this.http.get('http://myurladdress.com/', {}, {})
.then(data => {
this.content = JSON.parse(data.data);
})
.catch(error => {
//...
});