2

I'm new to Ionic/Angular. I need to print an array with some HTML in it

{
"code" : "06",
"descr" : "Some text:</br>Other text.<br/>Other text</br>Other text."
}

But it doesn't go to a new line, it prints even the tag in my page instead. There's a way to avoid this?

I've read something about ng-bind-html-unsafe but apparently has been removed from angular.

William Manzato
  • 199
  • 2
  • 10

1 Answers1

4

Try to use innerHtml:

<ng-container *ngFor="let item of yourArray">
    <div [innerHTML]="item.descr"></div>
</ng-container>
StepUp
  • 36,391
  • 15
  • 88
  • 148