Skip to content

Instantly share code, notes, and snippets.

@marijnkoolen
Forked from jpauli4/AS2 (handed in)
Created February 18, 2014 13:27
Show Gist options
  • Save marijnkoolen/9070963 to your computer and use it in GitHub Desktop.
Save marijnkoolen/9070963 to your computer and use it in GitHub Desktop.
var data = {
Students : [
{ name : "Jade", StudentNumber: "10350764" },
{ name : "Anouk", StudentNumber: "0000000" },
]
Assignments : [
{ Number : "1", description : "Alternatives" },
{ Number: "2", description: "Add Assignments and Students" },
{ Number: "3", description: "No idea" },
{ Number: "4", description: "suprise" },
{ Number: "5", description: "questionmark" }
]
};
var rawHtml = “<h2>Students</h2><ul> {{#Students}} <li>{{name}} - {{Student Number}} </li> {{/Students}} </ul> <h2>Assignments</h2><ul> {{#Assignments}} <li>{{Number}} {{description}}</li> {{/Assignments}} </ul>”;
var template = Handlebars.compile(rawHtml);
var html = template(data);
$(".session3").append(html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment