15

Let's assume I have a test property like that:

export class SomeComponent implements OnInit {

    testing = '<strong>Just testing</strong>';

}

And I add to my test.component.html this line:

{{ testing }}

The output will be <strong>Just testing</strong>. I want it to return Just Testing. How can I do that?

Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506
Eliya Cohen
  • 9,187
  • 10
  • 54
  • 101

1 Answers1

32

You can use innerHTML for this:

<span [innerHTML]="testing"></span>
Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506