https://github.com/bahrus/templ-model
templ-model is a web component that enables a declarative, HTML-based markup language to instantiate, and update, a JavaScript object, together with a view that is bound to the JavaScript object by way of Template Instantiation syntax.
https://github.com/bahrus/templ-model
custom-element custom-elements customelement customelements template template-instantiation web-component web-components webcomponent webcomponents
Last synced: 4 months ago
JSON representation
templ-model is a web component that enables a declarative, HTML-based markup language to instantiate, and update, a JavaScript object, together with a view that is bound to the JavaScript object by way of Template Instantiation syntax.
- Host: GitHub
- URL: https://github.com/bahrus/templ-model
- Owner: bahrus
- License: mit
- Created: 2021-05-23T13:23:39.000Z (about 4 years ago)
- Default Branch: baseline
- Last Pushed: 2021-05-29T17:46:44.000Z (about 4 years ago)
- Last Synced: 2025-01-31T23:46:03.810Z (4 months ago)
- Topics: custom-element, custom-elements, customelement, customelements, template, template-instantiation, web-component, web-components, webcomponent, webcomponents
- Language: TypeScript
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# templ-model
templ-model is a web component that enables a declarative, HTML-based markup language to instantiate, and update, a JavaScript object, together with a view that is bound to the JavaScript object by way of Template Instantiation syntax.
templ-model extends [obj-ml](https://github.com/bahrus/obj-ml), but integrates with (for now) Github's [template-parts library](https://github.com/github/template-parts).
templ-model supports a property, "templateInstance", which is expected to have a method called ["update"](https://github.com/github/template-parts/blob/main/src/template-instance.ts#L55) which the value of templ-model can be passed to as it changes.
templ-model supports another property, "template", that takes a step back, and sets, as a side effect, property templateInstance, after compiling the template using github's library.