1
votes

I created my dart web component that extends a DIV element. In DART I can add a DIV element to the DOM with:

DivElement div = new DivElement();
document.body.elements.add(div);

Dart html api

Can I do the same thing with my web component? What's the right syntax?

1

1 Answers

2
votes

Web UI Specification has a section about web component instantiation:

http://www.dartlang.org/articles/dart-web-components/spec.html#instantiation

... call new FooComponent.forElement(elem) in Dart. We don’t recommend using this approach because this constructor call cannot be used by itself–it requires several set up steps. We might have runtime libraries to make this easier in the future ...