Tiny Google Polymer or Mozilla X-Tags add-on which allows to use Backbone views as custom HTML elements. Also works with a native Custom Elements implementation if present.
Using component in HTML
<body>
<my-backbone-component label="{window.myLabel}"></my-backbone-component>
</body>
Backbone view definition
//TODO backbone view example here
document.registerBackbone('my-backbone-component', BackboneView);
Find complete examples in corresponding folder.
Original content of a custom element is injected to component as attributes._content
.
<my-backbone-component>Hello world</my-backbone-component>
In this case attributes._content is equal to "Hello world".
- Backbone
- X-Tag core or Polymer custom elements or native browser support for custom elements.
Copyright 2014 Stepan Suvorov aka stevermeister, Denis Radin aka PixelsCommander