Issue
I'm trying to read in some JSON files to HTML but the HTML characters are displaying as codes. I've tried using [innerHTML]="{{item.detail}}"
but its not working, any help please?
Code sample:
<ion-row *ngFor="let item of items; index as i;">
<span class="txt">{{item.topic}}</span><br>
<span class="txt">{{item.excerp}}</span><br>
<ion-col class="q">[innerHTML] = "{{item.detail}}"<br>
Solution
innerHTML is a directive
<ion-row *ngFor="let item of items; index as i;">
<span class="txt">{{item.topic}}</span><br>
<span class="txt">{{item.excerp}}</span><br>
<ion-col class="q" [innerHTML] = "item.detail"></ion-col>
</ion-row>
or
<ion-row *ngFor="let item of items; index as i;">
<span class="txt">{{item.topic}}</span><br>
<span class="txt">{{item.excerp}}</span><br>
<ion-col class="q" innerHTML = "{{item.detail}}"></ioncol>
</ion-row>
Answered By - sai kiran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.