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
  • 189
  • 1
  • 8

1 Answers1

4

Try to use innerHtml:

<ng-container *ngFor="let item of yourArray">
    <div [innerHTML]="item.descr"></div>
</ng-container>
StepUp
  • 30,747
  • 12
  • 76
  • 133