Saturday, January 23, 2016

Handlebars.js basic

Expression - {{body}}
Compilation - Handlebars.compile
Execution -  template(context)
Escaping - {{expression}}
Non-escaping - {{{expression}}} or Handlebars.SafeString
Block - {{#each}}
Content goes here.
{{/each}}
Helper - Handlebars.registerHelper, {{#helperName name="value"}}
Path - {{author.name}}, or ../parentName
Helper and data name Conflict - this.name or ./name
Comments - {{!-- --}}
Literals -  literal values passed to them either as parameter arguments or hash arguments
Partials - Handlebars.registerPartial, {{> partialName name="value" }}
Built-In Helpers - if, else, unless, each, with, lookup, log

No comments:

Post a Comment