Moe-js v0.3


Moe-js templates are similar to Mustache/Handlebars templates, but there are some important differences. This section shows how to write Moe-js templates.

Use {{}} to Embed Expressions

Use {{ and }} to delimit expressions:

<p>10 + 20 = {{ 10 + 20 }}</p>

Any valid JavaScript expression can be used:

<p>sin(0.5) = {{ Math.sin(0.5) }}</p>

Escaped vs Non-Escaped Output

Double braces cause the rendered text to be HTML encoded:


Results in:


Use triple braces to suppress encoding:


Results in: