Event Bindings

You can bind event handlers to Wijmo web components' specific events using Angular (eventName)="handler" syntax.

The following examples binds wjc-input-number and wjc-linear-gauge web components to the same theValue property of the parent Angular component. It also binds event handlers to the value-changed event of the both web components. The event handler code updates the theValue property with a new component's value, thus implementing the two-way binding functionality.

<wjc-input-number #inpNum id="inpNumEvents"
                    [value]="theValue"
                    (value-changed)="theValue = $event.target.value"
                    step="10"
                    min="0"
                    max="100">
</wjc-input-number>
<wjc-linear-gauge id="gaugeEvents"
                    [value]="theValue"
                    (value-changed)="theValue = $event.target.value"
                    [step]="inpNum.step"
                    [min]="inpNum.min"
                    [max]="inpNum.max"
                    is-read-only="false"
                    is-animated="false"
                    thumb-size="10"
                    style="display:block;height:30px">
    <wjc-range wj-property="face" thickness="0.25"></wjc-range>
    <wjc-range wj-property="pointer" thickness="0.25"></wjc-range>
</wjc-linear-gauge>

Live result: