Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Handlebars template
<!DOCTYPE html>
<meta charset="UTF-8">
<script src="" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="" crossorigin="anonymous"></script>
<div id="main">
<script type="text/x-handlebars-template">
{{#each .}}
var items = [
{name: "enzo", age:52},
{name: "beppe", age: 33},
{name: "ste", age: 41}
(function(data) {
var source = $('#main script').text(); // no html to avoid inner rendering
var template = Handlebars.compile(source.trim());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment