ndf-elements
Version:
My collection of useful custom elements.
35 lines (27 loc) • 729 B
JavaScript
/**
* Boilerplate template.
*
* @copyright © Nick Freear, 09-Dec-2021.
*
* @class MyFoobarElement
* @tagName my-foobar
* @property {tagName} <my-foobar> - Create a my-foobar element.
* @status beta
* @since 1.0.0
*/
import { MyElement } from '../MyElement.js';
export class MyFoobarElement extends MyElement {
static getTag () {
return 'my-foobar';
}
/* constructor () { // "Useless constructor"!
super();
} */
async connectedCallback () {
// const name = this.getAttribute('name') || 'A name attribute';
await this.getTemplate('my-foobar');
console.debug('my-foobar:', this);
}
}
// Was: MyFoobarElement.define();
// Was: customElements.define('my-foobar', MyFoobarElement);