Angular wants to generate a html page from the json string it receives, which has been escaped, but always displays only the string and not the label.

problem description

For the project of

angular-material, I want to change it to generate the page tag dynamically through the json string passed in the background. If I haven"t done it, I want to try a simple

first.

htmlString = "

1111111 < / div >"
Page directly {{htmlString}}
Page displays string

and then changed to a string
page still displays a string, have you done it? Why only the string

is displayed?

write a safe conversion pipeline similar to:

  

you should use element.nativeElement.innerHTML = htmlString

Menu