javascript - How do I write this pug function in handlebars? -
can tell me how can write following pug code in handlebars code?
ul product in products li #{product.product} li #{product.price}
i found following code, have populate 2 points per iteration. don't know how implement that.
handlebars.registerhelper('list', function(n, block) { var accum = ''; for(n in block) accum1 += block.fn(n); return accum; });
thanks.
try this
<ul> {{#each products}} <li>{{product}}</li> <li>{{price}}</li> {{/each}} </ul>
Comments
Post a Comment