0
I have a JSON where the contents of some fields are HTML, I would like to present the HTML in the Ionic View already rendered.
This is the JSON:
[{"data":"2018-09-05","categoria":"1","desafio":"
\r\n
Burp 20x1<\/li>\r\n
Teste 30x4<\/li>\r\n
Variação 50x10<\/li>\r\n<\/ul>\r\n
Competição<\/strong><\/p>\r\n
\r\n
Luta livre<\/li>\r\n
Burp<\/li>\r\n<\/ul>","titulo":"Desafio do Dia"}]
The "challenge" field is in HTML, how to render HTML in View?
<ion-header>
<ion-navbar color="dark">
<ion-title text-center>Workout do Dia</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div class="container">
<ul *ngFor="let workout of workoutdetalhes">
<li><span></span>
<div>
<div class="title">{{workout.titulo}}</div>
<div class="info">{{workout.desafio}}</div>
</div>
</li>
</ul>
</div>
</ion-content>
Thanks @Hitmacreed wasn’t sure how to put it, it worked: <ion-card-content [innerHTML]="Workout.desafio"> {{Workout.desafio}} </ion-card-content> Thanks.
– Ramos
@Hitmacreed, it is recommended that you detail a little more your answer, explaining in general what you do.
– João Martins
It would be interesting if you detailed your answer a little, explaining why @Ramos should use this part in their code.
– David Alves