How to undo bypassSecurityTrustHtml, i.e convert SafeValue back to string

流过昼夜 提交于 2019-12-06 05:46:58

I don't know if you already found a fix for this, but, if you just want the original value, marked as safe:

var yourString = this.domSanitizer.sanitize(SecurityContext.HTML, data)

I've dug through the source code and it appears that it is not possible to get the original string from a SafeValue. So I guess I'll have to keep parallel data array for all the unsafe values.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!