Angular2 parse string to html

前端 未结 1 1713
误落风尘
误落风尘 2021-02-03 18:11

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:

{{rss.desc         


        
相关标签:
1条回答
  • 2021-02-03 18:45

    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.

    0 讨论(0)
提交回复
热议问题