Bind Attribute
The $bind
directive creates a two-way binding between form inputs and data properties.
Usage
~index.html
<input $bind="propertyName">
How it Works
- The framework sets up listeners for input changes.
- When the input value changes, it updates the bound property.
- When the bound property changes programmatically, it updates the input value.
Error Handling
If the bound property doesn't exist, the framework typically creates it or logs an error to the console.
note
note
$bind
simplifies form handling by automatically synchronizing input values with data properties.