Menu

Element Annotations

Csaba Skrabák
<input @bind="boundVar">

Is an abbreviated form of [Two-way Binding]:

<input oninput="boundVar.value = this.value" value="{boundVar}">
var boundVar = new Observable("")

<input @sensitive="1000" onchange="callback()">

Is an equivalent of:

<input oninput="fire(1000, 'change', this)" onchange="callback()"/>
<script>
    function fire(msec, evtype, elem) {
        if (elem.dataset.tmout) {
            clearTimeout(elem.dataset.tmout)
        }
        elem.dataset.tmout = setTimeout(function() {
            const otherEvent = new Event(evtype)
            elem.dispatchEvent(otherEvent)
        }, msec)
    }
</script>

Related

Wiki: Home
Wiki: Two-way Binding

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.