Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
179
rated 0 times [  185] [ 6]  / answers: 1 / hits: 49515  / 11 Years ago, mon, january 20, 2014, 12:00:00

If just for example I do:



var = <a>Asd</a>;

<span>{{ var }}</span>


The string is printed like text and not as html, so how do I print the html ?


More From » html

 Answers
27

You should be using ng-bind-html directive.




Creates a binding that will innerHTML the result of evaluating the
expression into the current element in a secure way.




<ANY ng-bind-html={expression}>
...
</ANY>

[#73059] Saturday, January 18, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devonw

Total Points: 311
Total Questions: 116
Total Answers: 111

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
;