import { wired, on, component } from "capsid"; @component("counter") export class Counter { count: number = 0; @wired(".label") label: HTMLElement; __mount__() { this.update(); } @on.click.at(".plus") plus() { this.count++; this.update(); } @on.click.at(".minus") minus() { this.count--; this.update(); } /** Updates the label. */ update() { this.label.textContent = `${this.count}`; } }