With ng-bind-html-unsafe removed, how do I inject HTML?

后端 未结 10 2176
不思量自难忘°
不思量自难忘° 2020-11-22 04:06

I\'m trying to use $sanitize provider and the ng-bind-htm-unsafe directive to allow my controller to inject HTML into a DIV.

However, I can

10条回答
  •  野的像风
    2020-11-22 04:40

    I've had a similar problem. Still couldn't get content from my markdown files hosted on github.

    After setting up a whitelist (with added github domain) to the $sceDelegateProvider in app.js it worked like a charm.

    Description: Using a whitelist instead of wrapping as trusted if you load content from a different urls.

    Docs: $sceDelegateProvider and ngInclude (for fetching, compiling and including external HTML fragment)

提交回复
热议问题