I use [innerHTML]
to add some content to a div [innerHTML]="value"
.
When value
contains HTML e.g. some <i>text</i> foo bar
then the italic style will be rendered because it is treated as safe.
Is there a way that I can escape ALL of its html somehow?
E.g. i want the result to be some <i>text</i> lorem
UPDATE
Here is a more qualified example what I try to do
<div [innerHTML] = value | highlight
I also use a pipe called highlight which adds some HTML highlighting stuff, so innerText
does not work for me. I really need to escape all HTML from value
before