sbaaaang sbaaaang - 1 year ago 90
HTML Question

How to print html string as html

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 ?

Answer Source

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}">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download