# \[SOLVED\] Viewing html content in \<ion-card-content\>

**URL:** <https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500>\
**Category:** ionic-v3\
**Created:** [February 14, 2018, 4:33pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500 "2018-02-14T16:33:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrunoGZ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunogz/32/117250_2.png) [@BrunoGZ](https://forum.ionicframework.com/u/BrunoGZ)\
**Post date:** [February 14, 2018, 4:33pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/1 "2018-02-14T16:33:07Z")

</div>

I have this:

```
    <ion-card-content>
        <p align="justify">{{ mensagem[2] }}</p>
    </ion-card-content>

```

And {{ mensagem[2] }} is:

```
    <strong>Line 1</strong> <br> Line 2

```

I would like it to be displayed respecting the html tags, including formatting and line breaks, but is being displayed as plain text.

Is it possible to display as html?

Thanks.

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [February 14, 2018, 4:43pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/2 "2018-02-14T16:43:22Z")

</div>

Read up on Angular’s Domain Sanitizer. The answer to your question is “yes, but you need to tel Angular your HTML is safe,”

---

<div class="post-metadata">

**Author:** ![BrunoGZ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunogz/32/117250_2.png) [@BrunoGZ](https://forum.ionicframework.com/u/BrunoGZ)\
**Post date:** [February 14, 2018, 5:58pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/3 "2018-02-14T17:58:34Z")

</div>

It works.  
Thank you.

---

<div class="post-metadata">

**Author:** ![jdalvarezp](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jdalvarezp/32/124670_2.png) [@jdalvarezp](https://forum.ionicframework.com/u/jdalvarezp)\
**Post date:** [January 29, 2020, 8:06pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/4 "2020-01-29T20:06:15Z")

</div>

Please tell me, how can i do this, thanks

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [January 29, 2020, 8:10pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/5 "2020-01-29T20:10:16Z")

</div>

> [@jdalvarezp](#):
>
> how can i do this

I would suggest doing absolutely everything possible under the sun to avoid it. It is deliberately made difficult for security reasons, and it also makes the framework’s life a lot harder. Life goes so much more smoothly if HTML stays in templates.

If you can back up and describe your requirements in a non-technical way, perhaps people can suggest alternative implementation strategies that avoid all the drawbacks of manual sanitization.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:01pm UTC](https://forum.ionicframework.com/t/solved-viewing-html-content-in-ion-card-content/121500/6 "2021-07-19T21:01:52Z")

</div>


