daniel daniel - 1 year ago 172
Javascript Question

Add html in *ng-for loop in angular 2

I want to add html code from a variable inside a for loop in angular 2:

<li *ng-for="#c of myHtmlItems">

The html is only added as a string

kit kit
Answer Source

you could do:

    <li *ng-for="#c of myHtmlItems" inner-html="{{c.myHtml}}></li>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download