Angular 2 return html instead of string [duplicate]

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?

0

1 Answer

You can use innerHTML for this:

<span [innerHTML]="testing"></span>

You Might Also Like