/ PLAYGROUND

Models demo This session demonstrates model bindings between form inputs and component data, as explained in the docs.

Code

Components [?] Routes [?] Methods [?] Data [?]
<!-- COMPONENT MASTER -->
<div>
    <input type=text data-lmodel=name>
    <p>Name is: {{name}}</p>
    <p><button>Change name property to "John"</button><p>
    <p>(Or you can change it via the console - <code>lpg.app.components.master[0].data.name = 'Felicity';</code>)</p>
</div>
<script>
this.data.name = '';
this.DOM.querySelector('button').onclick = () => this.data.name = 'John';
</script>
//JS object of route data (optional)
{}
//JS object of filter methods (optional)
{}
//JS object of start data for master component
{}
Page help