【发布时间】:2018-06-25 11:01:30
【问题描述】:
我研究了使用 angular 6 元素的不同示例,发现它令人印象深刻。当您将自定义组件连接到 AppModule(根模块)时,所有这些都描述了方法。我想将我的自定义组件保存在一个单独的模块(功能模块)中。每次我试图实现这一点时,我都会收到下一个错误 -
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
有谁知道如何在单独的模块中实现它?
谢谢!
【问题讨论】:
-
您是否尝试导航到具有非根模块的模块的功能文件夹?您用于创建组件的命令是什么
-
npm i document-register-element@1.8.1是一些教程的一部分,可以在这里查看:stackoverflow.com/questions/50553449/…
标签: angular angular6 angular-elements