Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

readme.md

Dynamic Data-Binding of Custom Elements

This demo illustrates two-way dynamic data-binding on sub-properties. One instance is declared in the dom the other is created through document.createElement.

Elements

This is a very simple elements that holds the bindable properties name.firstname and name.lastname. This data is displayed in two <span> and editable using one <my-input> custom element and one overloaded <input> native element.

Is a custom elements that wraps a native html <input> to allow two-way binding with its value property.

The function createBindableInput() creates an <input> and overloads it with a new Binder. Internal binding is made to sync input.value and input._data.value. For this purpose a custom setter is provided.