synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Add support for interfacing with a template or DOM fragment

Open bruth opened this issue 14 years ago • 1 comments

Currently only one binding can be setup at a time, but it would be very useful to something like:

template = '<div class="book">
    <h1 role="title"></h1>
    <em role="author"></em>
    <p role="summary"></p>
 </div>'

fragment = $(template)

model = new Backbone.Model
    title: 'Secrets of a JavaScript Ninja'
    author: 'John Resig'
    summary: 'Learn to be a true JavaScript ninja like John..'

fragment.observe model

bruth avatar Sep 19 '11 20:09 bruth

This would be a great next step. If it could stay de-coupled from the template engine and allow somehow for both DOM (Angular/rivets-style) and string templates (Handlebars, Underscore, etc), it would be truly amazing.

alanchrt avatar Jul 25 '13 21:07 alanchrt