Ionic - Problems Pulling Data from PHP Database

Asked

Viewed 51 times

0

Hello, I would like to know how I can pull the database data already with the tags in html.

I collect the data and they come normally, but my table is composed by title, content and in this content I put texts like this:

<p>exemplo</p><p>exemplo</p><p><strong>exemplo</strong></p><p>exemplo</p>

when I pull it on the Ionic with:

<div id="adwaa4fs"> {{dados[0].conteudo}} </div>

it shows on the screen:

<p>exemplo</p><p>exemplo</p><p><strong>exemplo</strong></p><p>exemplo</p>

and wanted him to show: example example example example

type already with the html tags worked, someone can help me ?

  • 1

    From the looks of it, tags are already working. If you are trying to display this content: <p>exemplo</p><p>exemplo</p><p><strong>exemplo</strong></p><p>exemplo</p> the lines will break even as you are inserting several paragraphs <p>. To stay on the same track I’d have to change it to something like: <p>exemplo exemplo exemplo <strong>exemplo</strong> exemplo</p>.

  • i want to display broken but the Ionic n is breaking is showing everything in a row

  • sorry I explained wrong in the post, I’ve edited it

  • No problem. Have a look at this link and see if it helps you: https://stackoverflow.com/questions/44759693/render-html-content-in-ionic-v3

1 answer

0


Use this property: [innerHTML]

<div [innerHTML]="dados[0].conteudo"></div>
  • Thank you, you saved my friend’s day

Browser other questions tagged

You are not signed in. Login or sign up in order to post.