प्रकार का तर्क 'NgElementConstructor <अज्ञात>' प्रकार 'CustomElementConstructor' के पैरामीटर के लिए उपलब्ध नहीं है


10

मुझे VSCode (1.44.0-insider) में Angular9 के साथ Angular Elements बनाने में एक अजीब चेतावनी मिल रही है:

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

के टाइप helloElementटाइपप्रति से एक त्रुटि संदेश के साथ स्वीकार नहीं किया है:

प्रकार का तर्क 'NgElementConstructor' प्रकार 'CustomElementConstructor' के पैरामीटर के लिए लागू नहीं है

जवाबों:


8

ऐसा लगता है कि यह अगली रिलीज के साथ तय हो जाएगा: https://github.com/angular/angular/pull/35864

आप अगली रिलीज़ (9.1.0-नेक्स्ट) को अपडेट करके अपने प्रोजेक्ट के लिए पहले ही इसका परीक्षण कर सकते हैं।

ng update @angular/core --next 

यदि अद्यतन के साथ संकुल स्थापित नहीं हैं, तो त्रुटियों से बचने के लिए "एनजी अपडेट @ कोणीय / क्ली @ कोणीय / कोर" का उपयोग करें।
— उत्कर्ष गुप्त
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.