from this link in javascript, customs element extending button is made as:
var MegaButton = document.registerElement('mega-button', {
prototype: Object.create(HTMLButtonElement.prototype),
extends: 'button'
});
<button is="mega-button">
I tried making the same using dart, by this code:
class MegaButton extends ButtonElement {
static final tag = 'mega-button';
factory MegaButton()=>new Element.tag('button', tag);
MegaButton.created() : super.created() {
var shadow = this.createShadowRoot();
shadow.text='save';
}
}
document.registerElement(MegaButton.tag, MegaButton);
in the html file
<button is="mega-button"></button>
<mega-button>click me</mega-button>
but got this error:
Exception: Unsupported operation: Class must provide extendsTag if base native class is not HTMLElement
any help pls. thanks