Web Components in Dart


I’ve got a few questions considering web-components in Dart:

1.) How can we call a method of a component and foremost, how to get access to the component instance? I know we can supply properties to web components but not how to call methods on them and get their instance.

2.) How is it possible to manually instantiate an instance of a component? The reason is that I want i.e. to show a modal form containing my component and on each click want to have the web component to be re-created to show fresh content.



For 1.) Seems it is done via document.query(‘#my-component-id’).xtag

For 2.) Seems that’s possible by code but overly complex as of now

See also http://www.dartlang.org/articles/dart-web-components/spec.html for more info

Answered By – anderswelt

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.