JsBarcode icon indicating copy to clipboard operation
JsBarcode copied to clipboard

In ShadowDom : NoElementException: No element to render on.

Open AshMcConnell opened this issue 1 year ago • 0 comments

Hi Folks,

Having trouble when I have my Angular element in the shadow dom. It can't seem to find the element. I am loading in the javascript to execute JsBarcode from a server and creating a script element on the shadowRoot. It is executing, but it can't find the element in question.

Is there any way to work around this issue?

set scriptContents(javascript: string) {
        this._scriptContents = javascript;
        const scriptElement = document.createElement('script');
        

        scriptElement.textContent = javascript;
        this.elementRef.nativeElement.shadowRoot.appendChild(scriptElement);
    }

AshMcConnell avatar Nov 11 '22 11:11 AshMcConnell