Angular2 Pipes: output raw HTML

后端 未结 9 2073
春和景丽
春和景丽 2020-12-13 17:43

I\'m trying to create an Angular2 custom pipe that outputs raw html. I want it to simply convert newlines in the input into HTML line breaks. How do I output raw HTML from a

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 18:07

    What about:

    {{text}}

    Or for html:

    
    

    I often use the HTML pre element that represents preformatted text.

    Another trick I often use to format Json is:

    {{jsonString | json}}

提交回复
热议问题