Angular中的Web组件;测试-> customElements未定义

时间:2019-06-05 11:19:47

标签: angular testing web-component custom-element

我将Angular 7与某些Web组件结合使用。我在共享模块中有一个角度组件,其中包含一个Web组件。因此,我

import '@mystuff/component-name'

并使用

schemas: [CUSTOM_ELEMENTS_SCHEMA]

但是,在测试应用程序时,我得到了一个

ReferenceError: customElements is not defined

如果我根本不使用Web组件,而仅在共享模块中使用导入,也会发生这种情况。

我该如何解决?谢谢!

0 个答案:

没有答案