A bridge to be able to integrate web components with knockout.js
npm install knockout-web-componentssh
npm i knockout-web-components
`
Usage
Import the library in your app:
`js
import "knockout-web-components";
`
This will automatically add a new knockout bindingHandler with the name webcomp.
Now you can pass properties and event listeners via the data-bind attribute in your templates:
`html
`
If you pass onservables as parameters here they will be unwraped and provided to the web component as plain JSON.
Parameters that start with on are treated like event listeners and internally it will call addEventListener on the web component to listen for events and invoke the function you provided.
For the event registration the on prefix will be ignored and instead only the parts after it will be used. This also transforms the first letter of the event name to lowercase.
For example onInput would listen for events with the name input`.