Angular Inner HTML binding:

Updated: Nov 1, 2019






Binding of angular internal HTML: I write an angular app and I have an HTML response to view.


How do I? How do I do? This encodes all HTML characters when I use the{{ myVal}} binding syntax.


I need to connect a div's innerHTML to the variable value somewhere.


Solution :


The correct syntax is the following:

<div [innerHTML]="theHtmlString"></div>

Works on 8.2.6

0 views
Never Miss a Post. Subscribe Now!

Contact Us: nawabblog@gmail.com

Location : Bangalore India.

© 2019 proudly created  by Nawab Ahmad. 

  • Nawab Ahmad
  • Grey Twitter Icon
  • Nawab Ahmad