-
-
Save marijnkoolen/9070963 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
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