• Home
  • sample of handlebars.js with underscore.js

sample of handlebars.js with underscore.js

January 16, 2015 Ning 0 Comments
var cartTemplate = '

Name: {{na}} Sku: {{sk}}

'; var compiled = Handlebars.compile(cartTemplate); console.log(compiled({na: ‘Compact Round Trampoline’, sk : ‘R54’})); console.log(compiled({na: ‘Medium Round Trampoline, sk : ‘R79’}));

From above sample code, we can define very clear template (no need JavaScript in the template source).

leave a comment

*