UNPKG

@danielkalen/simplybind

Version:

Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.

29 lines (27 loc) 797 B
<template> <form> <h4>Products</h4> <label> <input type="checkbox" model.bind="{ id: 0, name: 'Motherboard' }" matcher.bind="productMatcher" checked.bind="selectedProducts"> Motherboard </label> <label> <input type="checkbox" model.bind="{ id: 1, name: 'CPU' }" matcher.bind="productMatcher" checked.bind="selectedProducts"> Motherboard </label> <label> <input type="checkbox" model.bind="{ id: 2, name: 'Memory' }" matcher.bind="productMatcher" checked.bind="selectedProducts"> Motherboard </label> Selected products: <ul> <li repeat.for="product of selectedProducts">${product.id} - ${product.name}</li> </ul> </form> </template>