backbone-components
use backbone views like webcomponents
Example
index.html:
BackboneComponents ;
component file test-view.html
:
<!-- html templates --> <!-- backbone view definition -->
- supports nested components
- easily define multiple html templates for a component
- handles dependencies for you
- lets you define css styles
- all in one file!
also see example
folder for more examples.
when starting example/index.html
with file://
protocol in chrome, start chrome option --allow-insecure-localhost
want to run from web server?
$ npm run static-server
static-server listening on http://localhost:3000
goto http://localhost:3000/example/ to see the example
requires: backbonejs, underscorejs and jquery
firefox requries web components polyfill to import