Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"IONIC 3" page adding html content variable

I am trying to add a variable containing html to my ionic 3 page

Ionic Page:

<ion-header>

  <ion-navbar>
    <ion-title>{{offeritem.data.nameprovider}}</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
  <div>
    {{offeritem.data.detailsoffer}}
  </div>
</ion-content>

However I am getting the following

Result:

<p>The table contains 30 pieces:</p><ul><li>5 Philadelphia Roll</li>
<li>5 Fantasia Roll</li>

Please let me know what I am doing wrong in this case.

Thanks in advance

like image 946
JADSAM Avatar asked May 22 '17 10:05

JADSAM


1 Answers

You should use [innerHTML] for ionic 3 like this:

<p [innerHTML]="yourVarHere"></p>
like image 164
Jose Agustin Villalobos Vargas Avatar answered Oct 24 '22 09:10

Jose Agustin Villalobos Vargas