Lit forms inspired by angular reactive forms
Lit forms inspired by angular reactive forms.
* Validation
* Dynamic fields (arrays)
* Automatic component updates
* Material components
``bash`
$ npm install --save @dkx/lit-forms
Dependencies:
* lit >=2.0.0-rc.1
* rxjs >=6.0.0
Define form:
`typescript`
this.form = defaultFormBuilder.create(this, root => [
root.control('email', ''),
root.control('password', ''),
]);
Render form:
`html`
Handle submit:
`typescript
if (!this.form.validate()) {
return;
}
console.log(this.form.value);
``
You can find more examples here.