Angular 从渲染组件中剥离 Web 组件?

问题描述

根据 this tutorial,我们需要将 tsconfig.json 编译器选项 allowJs 设置为 true 并包含 CUSTOM_ELEMENTS_SCHEMA,我已经完成了这两件事,如图所示在这次 Stackblitz 中:

https://stackblitz.com/edit/angular-web-component-stripping

我还在此处使用最新的 Angular 版本创建了一个最小的复制品:

https://github.com/fireflysemantics/scully-custom-element-test

在 Stackblitz 演示中,innerHTML 组件的 hello 设置为:

  <h1> Web Component Test</h1>
  <fs-image url="https://fireflysemantics.github.io/i/developer/instant-html-vscode.png"></fs-image>

然而,Angular 会剥离 fs-image 网络组件。我们需要做什么来包含它?

Angular 确实记录了这个警告:

警告:清理 HTML 删除了一些内容,请参阅 https://g.co/ng/security#xss

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...