How to allow html in return of angular2 pipe?

前端 未结 3 1120
故里飘歌
故里飘歌 2020-12-03 04:31

I have a pipe that returns a html string, however the string outputs escaped presumably as a default for security. I\'m sure there must be an option to allow html instead bu

3条回答
  •  一生所求
    2020-12-03 04:59

    I don't know if that is possible with a pipe. (It is, see @alexpods's answer.)

    Have you considered converting your pipe into a component with an input property? I.e., whatever is feeding your pipe, make that an input property of the component. Put the HTML that the pipe generates into the component's template.

提交回复
热议问题