Slide 20
Slide 20 text
class FlagIcon extends HTMLElement {
constructor() {
super();
this._countryCode = null;
}
static get observedAttributes() { return ["country"]; }
attributeChangedCallback(name, oldValue, newValue) {
this._countryCode = newValue;
this._updateRendering();
}
get country() { return this._countryCode; }
set country(v) { this.setAttribute("country", v); }
_updateRendering() { /* update the flag icon */ }
}