17

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 1

36

You can use innerHTML for this:

<span [innerHTML]="testing"></span>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.