【发布时间】:2017-06-19 03:20:53
【问题描述】:
我想在我的 Ionic 2 项目的 LoadingController 的内容选项中使用自定义组件,但是当加载出现时,浏览器控制台会向我显示消息:
WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).
并且组件没有显示,使测试我意识到使用任何其他非标准 HTML TAG 的 TAG 会引发此错误,我如何使用 Angular 2 安全性来绕过该错误?我想要的是:
this.loadingController.create({
spinner: 'hide',
content: `
<div>
<some-component></some-component>
<h3>a message...</h3>
</div>`
})
【问题讨论】:
-
您的组件是否包含在您的 ng 模块中?
-
是的,它已包含在内。
标签: angular typescript ionic2