Skip to content

Instantly share code, notes, and snippets.

@karolk
Created April 2, 2012 21:38
Show Gist options
  • Save karolk/2287406 to your computer and use it in GitHub Desktop.
Save karolk/2287406 to your computer and use it in GitHub Desktop.
temple.js templating example
<h1 data-templ="header"></h1>
<ul data-templ="items">
<li>
<strong data-templ="strong name"></strong>
<a href="#" data-templ="url name"></a>
</li>
</ul>
<p data-templ="empty">The list is empty.</p>
{
header: "Colors",
items: [
{name: "red", url: null},
{name: "green", strong: null,
url: {attr: "href", value: "#Green"},
},
{name: "blue", strong: null,
url: {attr: "href", value: "#Blue"}
}
],
empty: null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment