Friday 26 August 2016

angular2 template - Angular HTML binding




I am writing an Angular application and I have an HTML response I want to display.



How do I do that? If I simply use the binding syntax {{myVal}} it encodes all HTML characters (of course).



I need somehow to bind the innerHTML of a div to the variable value.


Answer



The correct syntax is the following:







Works on 8.2.14



Documentation Reference


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...