【发布时间】:2020-06-23 07:19:07
【问题描述】:
在使用 Angular9 创建 Angular 元素时,我在 VSCode(1.44.0-insider) 中收到了一个奇怪的警告:
export class AppModule {
constructor(private injector: Injector) {
const helloElement = createCustomElement(HelloComponent, {injector});
customElements.define('my-hello', helloElement);
}
ngDoBootstrap() {}
}
helloElement 的类型不被接受,并带有来自 typescript 的错误消息:
“NgElementConstructor”类型的参数不能分配给“CustomElementConstructor”类型的参数
【问题讨论】:
标签: angular visual-studio-code angular-elements