Skip to content

Instantly share code, notes, and snippets.

@giancorzo
Last active May 4, 2017 18:12
Show Gist options
  • Save giancorzo/3495041a3c4f021f6af24a973a21778c to your computer and use it in GitHub Desktop.
Save giancorzo/3495041a3c4f021f6af24a973a21778c to your computer and use it in GitHub Desktop.
(() => {
//Compile
var source = $('#entry-template').html();
var template = Handlebars.compile(source);
//Get data
var context = {title: "My New Post", body: "This is my first post!"};
var context2 = {title: "Another Post", body: "This is another post!"};
//Create HTML elements
$('#entries').append(template(context));
$('#entries').append(template(context2));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment