I've working on an AngularJS solution, in which ngSanitize is used to sanitize markup received from an Ajax call.

This markup will occasionally contain iframe tags.

When I test the app with iframe tags, ngSanitize seems to remove them.

Do you have any suggestions as to how to get ngSanitize to ignore iframe tags and allow them to render?

有帮助吗?

解决方案

Looks like this isn't possible using the current version of angular-sanitize.

An issue has been logged, to ask for the whitelists to be made extensible, so we can add more tags to them, such as .

Meantime, Brandy Isom has written a fix to enable such customization, and sent it as a pull-request to the Angular team. You can use this fix in the meantime.

(Hopefully it gets incorporated into the next version.)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top