[Fixed] Angular2 parse string to html


I’m importing rss items where in description there is a lot of html code (links, paragraphs, etc…). When I’m viewing it in component’s view like:


the output in site is like:

<a href="http://link.com">Something</a> <p>Long text</p>

How can I quickly and easy parse it to html? I don’t want to cross it with jQuery. Thank you


Not sure if I understand your question correctly, but this might be what you want

<div [innerHTML]="rss.description"></div>

See also In RC.1 some styles can't be added using binding syntax for how to allow “unsafe” HTML.

Leave a Reply

(*) Required, Your email will not be published