AngularJS - ngBindHtml and 'unsafe' html

前端 未结 2 435
不知归路
不知归路 2021-01-16 18:26

I am trying to render some unsafe HTML (basically a HTML snippet with some inline styling) and have the following code in my view:

2条回答
  •  粉色の甜心
    2021-01-16 19:26

    You can bypass it using $sce.trustAsHtml . See documentation

    self.snippet.content = $sce.trustAsHtml('some html');
    

提交回复
热议问题