Skip to content

Instantly share code, notes, and snippets.

@diverted247
Created December 2, 2013 05:19
Show Gist options
  • Select an option

  • Save diverted247/7745436 to your computer and use it in GitHub Desktop.

Select an option

Save diverted247/7745436 to your computer and use it in GitHub Desktop.
Rivets [] -> li
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rivets [] -> li</title>
</head>
<body>
<div id="template">
<li rv-each-todo="todo">
<input type="checkbox" rv-checked="todo.done">
<span>{ todo.name }</span>
</li>
</div>
<script src="rivets.min.js"></script>
<script>
window.light = {};
light.el = document.getElementById( "template" );
light.model = {
todo:[
{name:"hello 0", done:false },
{name:"hello 1", done:false },
{name:"hello 2", done:true },
{name:"hello 3", done:false },
{name:"hello 4", done:false },
{name:"hello 5", done:true },
{name:"hello 6", done:false },
{name:"hello 7", done:false }
]
};
light.binder = rivets.bind( light.el , light.model );
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment