liveBook · Manning

Data binding

As explained in Web Component Development with Modern Libraries and Tooling

A synchronization mechanism that connects component properties with rendered DOM values or behavior.

Data binding keeps component state and rendered DOM behavior synchronized. In a FAST custom element, template expressions read properties, while event bindings update them; observable changes then refresh dependent DOM. section 7.4

A reactive arithmetic component

The my-math component binds displayed values to n, double, and triple, and binds buttons to increment or decrement n. Changing n invokes nChanged, which recalculates double and triple, updating every displayed value. Getters can replace the derived observable properties; getters with changing dependencies require @volatile.

Attribute binding provides a related property-to-attribute connection. @attr maps a property to a custom-element attribute, with reflect, boolean, and fromView modes; converters translate values when attribute and property representations differ.

How Web Component Development with Modern Libraries and Tooling covers it

How deep it goes
Explains reactive properties, event updates, derived getters, attribute modes, and value converters through implementation examples.
Examples
Demonstrates a my-math component with increment and decrement buttons, derived arithmetic values, and getter-based alternatives.
What you can do after
Build it from scratch with FAST templates, observable properties, event bindings, decorators, and attribute converters.
How it connects
Ties data binding to custom elements, decorators, observable properties, getters, DOM attributes, and event handling.

Also explained in

Compare how 7 books explain data binding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Component Development with Modern Libraries and Tooling. The section links point to the parts of the book it draws on.