handlebars.js - Calling Javascript function from handlebar -


How to call JavaScript function inside the handlebar? Reason: I could not be able to break {{#each}} from the handlebar. So I need to do this javascript and do the logic.

You can do this with assistants;

  Handlar Registry Helper ("Print Items", Function (item) {var html = "& lt; ul & gt;"; Item. Each (Function (Entry) {html + = " ";}); html + =" & lt; / ul> "; return HTML;});  

and in your handlar template;

  {{printItems items}}  

Top code in your item list.

See for more information. Go to the Assistant section


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -