custom-element Questions
4
I am trying out a very simple application on angular elements on stackblitz and I am getting the following issue.
Error: Failed to construct 'HTMLElement': Please use the 'new'
operator, this D...
Dmso asked 27/5, 2018 at 15:1
1
Solved
Update 2024
Full blogpost:
https://dev.to/dannyengelman/web-component-developers-do-not-connect-with-the-connectedcallback-yet-4jo7
Update March 2023
Note: this works because in the next tick your ...
Bound asked 23/5, 2020 at 12:20
1
Solved
Consider this code:
//js
class FooBar extends HTMLElement {
constructor(){
super();
}
}
customElements.define('foo-bar', FooBar);
<!-- html -->
<foo-bar>
<h1>Test</h1&g...
Dybbuk asked 17/5, 2020 at 13:3
4
Is it possible to modify a custom element / web component class after it's been registered? This isn't something I'll typically (or ever) want to do in production code, but when prototyping or impl...
Broads asked 14/12, 2017 at 3:11
3
I have created an custom element in angular 7 using CUSTOM_ELEMENTS_SCHEMA.
My app.module.ts is as follows:
export class AppModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {...
Archaeological asked 13/2, 2019 at 4:44
1
Solved
The CSS ::slotted selector selects children of the <slot> element.
However, when trying to select grandchildren like with ::slotted(*), ::slotted(*) *, or ::slotted(* *), the selector d...
Timms asked 6/5, 2020 at 2:44
2
Is there any difference between Material Web Components (link) and Material Components Web (link)?
Material Web Components doesn't have much of an explanation other than
Built on top of the Ma...
Arbitrary asked 2/9, 2019 at 6:16
0
We have created a web component using custom elements with Angular 8. Part of the component is to show some custom icons (developed and packaged as a different app). As you can see in a previous qu...
Sastruga asked 20/3, 2020 at 14:19
2
Solved
WHEN I use custom ngDoBootstrap function instead of default bootstrap: [AppComponent] like this:
@NgModule({
imports: [ BrowserModule, FormsModule, AppRoutingModule ],
declarations: [ AppCompone...
Danialdaniala asked 5/3, 2020 at 14:55
2
I try to get Angular Elements working in IE11.
My custom element (simple button) is already displayed and the input binding is working as expected, but the output binding doesn't.
A click on my cu...
Selfdeceit asked 21/1, 2019 at 16:1
1
Solved
I realise that this question has been asked on a number of occasions, though the environment has changed since those questions where asked: notably, JSDom now supports custom elements.
These other...
Necrotomy asked 26/2, 2020 at 13:13
4
Angular Element: DOMException: Failed to execute 'define' on 'CustomElementRegistry'
I've created two custom elements using Angular Elements.
<capp-customtag1> is defined in customtag1.js
<capp-customtag2> is defined in customtag2.js
I load <capp-customtag1> wit...
Filterable asked 6/7, 2018 at 20:33
1
Solved
I'm new to web components, and I've noticed some examples set the dom in the custom-element's constructor, while others do it in the connectedCallback.
As both seem to work fine(although I tried on...
Torrefy asked 29/1, 2020 at 15:10
0
Let's say I have a custom element definition, written in JavaScript with JSDoc annotations:
my-element.js:
/** @element my-element */
export class MyElement extends HTMLElement { }
customElements...
Basophil asked 27/1, 2020 at 6:31
4
Hi All I am a beginner in javaScript and currently exploring JS Web-component and I got stuck due to some use cases
1 ) I want to pass a JS Object into my component like
<my-component data=ob...
Azral asked 2/4, 2019 at 6:49
1
Uncaught promise when registering a custom element using the latest
sapper, svelte, nodeJS, and rollup stack using the following
statements.
REPL example: https://svelte.dev/repl/489ee8acd108...
Essie asked 21/12, 2019 at 14:44
2
Solved
I just started learning about the HTML custom elements, and through reading a series of intros, tutorials, and documentation, I think I have a good handle on how it works, but I have a philosophica...
Voltmer asked 21/9, 2018 at 2:53
1
Solved
I would like to know if it is possible to use different angular elements (custom elements) built with different versions of Angular.
I have heard that zone.js was polluting the global scope.
Thank...
Assurbanipal asked 10/12, 2019 at 10:51
0
I have a huge Angular application where a couple of components are exported as @angular/elements.
These components (although they still use shared services and components) are used in a different ...
Transalpine asked 5/12, 2019 at 9:4
4
I'm learning web components. When designing a custom element, I have to decide what is going to be hidden in the the shadow DOM. The remainder will then be exposed in the light DOM.
As far as I un...
Sapodilla asked 22/1, 2019 at 2:30
2
I need to build a component that should need to work with both specs, custom elements spec v0 which got deprecated and custom elements spec v1, latest stable version.
If I build components with cu...
Nootka asked 9/10, 2019 at 6:39
1
Solved
I have the following ELM view element:
Html.node "test-elem"
[ Attributes.attribute "data-count" (model.count |> String.fromInt) ]
[]
test-elem is a custom html element:
constructor() {
...
Mesozoic asked 10/10, 2019 at 12:53
1
The problem arises when we are going to create a custom radio button as a web component using Shadow Dom.
Normally when we are using radio buttons, we usually give the same name to the grouped rad...
Alister asked 3/9, 2019 at 11:43
12
Solved
I've been unable to find a definitive answer to whether custom tags are valid in HTML5, like this:
<greeting>Hello!</greeting>
I've found nothing in the spec one way or the other:
h...
Married asked 23/3, 2012 at 18:59
1
Solved
Consider a very simply custom element using shadow DOM:
customElements.define('shadow-element', class ShadowElement extends HTMLElement {
constructor() {
super();
this.styleTag = documen...
Pohai asked 12/8, 2019 at 11:17
© 2022 - 2024 — McMap. All rights reserved.