Last active
August 29, 2015 14:25
-
-
Save aweary/04938e4a42c6f224ab2c to your computer and use it in GitHub Desktop.
grasp.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-grasp-template='main' class='container'> | |
<div class='header'> | |
<h1 class='title'> Welcome to #{title}, on #{date}! </h1> | |
<h3 class='sub-title'> #{subtitle} </h3> | |
<span> #{time} </span> | |
</div> | |
<div class='post-container'> | |
<div class='post' data-repeat='post in posts'> | |
<h4 class='post-title'> #{post.title} </h4> | |
<p class='post-content'> #{post.content} </p> | |
<span> #{time} </span> | |
</div> | |
</div> | |
</div> | |
<script> | |
/* Create the template */ | |
var template = grasp.template('main'); | |
/* Bind the data */ | |
template.bind({ | |
title: 'My Test Website' | |
subtitle: 'This is for some tests.', | |
time: Date.now(), | |
date: new Date(); | |
posts: [ | |
{title: 'My first post', content: 'This is where the content goes'}, | |
{title: 'My second post', content: 'This is also where the content goes'} | |
] | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment