型の引数「NgElementConstructor <不明>」型「CustomElementConstructor」のパラメータに割り当て可能ではありません

ステパンスヴォーロフ:

私は角要素を作成してAngular9とVSCode(1.44.0-インサイダー)で奇妙な警告を取得しています:

export class AppModule { 
  constructor(private injector: Injector) {
    const helloElement = createCustomElement(HelloComponent, {injector});
    customElements.define('my-hello', helloElement);
  }
  ngDoBootstrap() {}
}

種類はhelloElementtypescriptですから、エラーメッセージを受け付けられません。

型「NgElementConstructor」の引数はタイプ「CustomElementConstructor」のパラメータに割り当て可能ではありません

drfrontend 1:

次のリリースで修正される予定らしい。https://github.com/angular/angular/pull/35864

あなたは既に次のリリース(9.1.0-next.4)に更新することで、プロジェクトのためにそれをテストすることができます。

ng update @angular/core --next 

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=369688&siteId=1