16

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
  • 623,577
  • 216
  • 2,003
  • 1,567
Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116

1 Answers1

35

You can use innerHTML for this:

<span [innerHTML]="testing"></span>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567