I'm trying to render an html string so that it displays links, etc using Ionic. This is my very first Ionic app.
<ion-content class="home">
<ion-list>
<ion-item *ngFor="let f of item">
<h2 class="question" style="white-space:initial;" ng-bind-html="{{f.question}}">{{f.question}}</h2>
<p class="answer" style="white-space:initial;" ng-bind-html="{{f.answer}}">{{f.answer}}</p>
</ion-item>
</ion-list>
</ion-content>
I've tried ng-bind-html as above and it's saying...
Unhandled Promise rejection: Template parse errors: Can't bind to 'ng-bind-html' since it isn't a known property of 'h2'. ("
I've also tried ng-bind-html-safe but that produces the same error. Without the ng-bind-html code, the string is displayed but with the html characters not being interpreted.
Also, here is the code coming from the .ts file
this.faqService.load()
.then(data1 => {
this.item = data1;
});
{{f.question}}
][innerHTML]="{{f.answer}}">{{f.answer}}
– Cary Mar 07 '17 at 05:47