Skip to content

Instantly share code, notes, and snippets.

@bramstein
Created May 5, 2011 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramstein/956769 to your computer and use it in GitHub Desktop.
Save bramstein/956769 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<script src="mock.js"></script>
<script src="array.js"></script>
<script src="dom.js"></script>
<script src="object.js"></script>
<script src="template.js"></script>
<script src="../1.js"></script>
<script src="../2.js"></script>
<script src="../3.js"></script>
<script>
window.onload = function () {
treesaver.template.expand(v1, document.getElementById('t1'));
treesaver.template.expand({ item: v2}, document.getElementById('t2'));
treesaver.template.expand(v3, document.getElementById('t3'));
};
</script>
</head>
<body>
<div id="t1" data-bind="pageNumber pageTotal">
Page {{pageNumber}} of {{pageTotal}}.
</div>
<div id="t2">
<ul data-bind="item">
<li>
<h1><a data-bind="url:href title"></a></h2>
<p data-bind="author"></p>
<img data-bind="thumb:src"/>
<!-- Note that the descendants are still created if the children array is empty -->
<ul data-bind="children">
<li>
<h2><a data-bind="url:href title"></a></h2>
<p data-bind="author"></p>
<img data-bind="thumb:src"/>
</li>
</ul>
</li>
</ul>
</div>
<div id="t3">
<a data-bind="url:href title:href" data-href="http://www.twitter.com/?status=Check%20out%20{{title}}%20at%20{{url}}">Tweet this</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment