angular-elements

ERROR DOMException : Failed to execute 'define' on 'CustomElementRegisry' : the name “xyz” has already been used with this registry

血红的双手。 提交于 2021-01-29 20:12:40
问题 I have created two angular component with angular ~9.0.7 and I am using it to another angular application. if I use one component, everything work fine but if I use both angular component its giving error. ERROR DOMException : Failed to execute 'define' on 'CustomElementRegisry' : the name "xyz" has already been used with this registry. I tried below code but it's not working : if (!customElements.get('the-element')) { customElements.define('the-element', HTMLTheElement); } Please help. 来源:

Using multiple angular elements as web components within an angular project

馋奶兔 提交于 2020-12-06 04:45:10
问题 Given three @angular projects all using v6.1.9: host , alpha , and beta alpha and beta create and define a web component each using @angular/elements as such: constructor(private injector: Injector) {} ngDoBootstrap() { const config: NgElementConfig = { injector: this.injector }; const component= createCustomElement(component, config); customElements.define("alpha-component", component); // beta-component respectively } alpha and beta are built using ng build --prod --output-hashing none and

Angular Elements EventEmmitter : $event not showing emitted value

回眸只為那壹抹淺笑 提交于 2020-06-15 07:41:22
问题 I am stuck while working with Custom Angular Elements, Whenever i emit a value i.e true or false , it works fine while using element in same angular project, whenever i use the element in other project by creating its bundled JS file. It shows the Inputs events in the parent component. This is my Angular Elements in Parent Component <app-address [model]="address" [isAddressValid]="isValid" (getValidity)="getValue($event)" placeholder="placeholder" label="label" isRequired="false" ></app

Angular Elements EventEmmitter : $event not showing emitted value

独自空忆成欢 提交于 2020-06-15 07:37:05
问题 I am stuck while working with Custom Angular Elements, Whenever i emit a value i.e true or false , it works fine while using element in same angular project, whenever i use the element in other project by creating its bundled JS file. It shows the Inputs events in the parent component. This is my Angular Elements in Parent Component <app-address [model]="address" [isAddressValid]="isValid" (getValidity)="getValue($event)" placeholder="placeholder" label="label" isRequired="false" ></app