类型“ NgElementConstructor <未知>”的参数无法分配给“ CustomElementConstructor”类型的参数


9

我在创建Angular Elements的Angular9中的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”类型的参数

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.