Last active
May 4, 2017 18:12
-
-
Save giancorzo/3495041a3c4f021f6af24a973a21778c to your computer and use it in GitHub Desktop.
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
(() => { | |
//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