# Data Binding

You can bind your [data properties](/the-essentials/properties.md) to input elements within your [template](/the-essentials/templates.md) using [**wire:model**](/template-directives/wire-model.md).

{% tabs %}
{% tab title="BoxLang" %}

```javascript
// wires/MyComponent.bx
class extends="cbwire.models.Component" {
    
    // Data properties
    data = {
        "name": ""
    };
}
```

{% endtab %}

{% tab title="CFML" %}

```javascript
// wires/MyComponent.cfc
component extends="cbwire.models.Component" {
    
    // Data properties
    data = {
        "name": ""
    };
}
```

{% endtab %}
{% endtabs %}

```html
<!--- ./wires/MyComponent.bxm|cfm --->
<div>
    <form>
        <input wire:model.live="name" type="text">
        Name updated at #now()#
    </form>
</div>
```

## Resources

{% hint style="success" %}
See the [wire:model](/template-directives/wire-model.md) page for complete documentation.
{% endhint %}

{% hint style="info" %}
When [data properties](/the-essentials/properties.md) are updated using **wire:model**, CBWIRE has several methods you can hook into such as **onUpdate** and **onHyrdate** ( See [Lifecycle Methods](/the-essentials/lifecycle-events.md) ).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cbwire.ortusbooks.com/the-essentials/data-binding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
