Client Side Template

{/* comment */}


Comments can be added to client-side templates using the {/* ... */} directive.

{/* this is a comment */}
Comments must have white space after the first "*" and before the last "*".

When the template is expanded, any space taken by comments is ignored. Comments are useful for the obvious use case of adding explanations to your templates. But another less obvious use case for comments is to make templates more readable. For example, in certain cases your templates should not include any line breaks because the space taken by the line break will affect how the expanded template appears. However, this makes the template difficult to read. In the example below, an empty comment that spans two lines is used to insert a line break into the template for readability. This line break is ignored, however, when the template is expanded.

{/* this is the firstname field */}
<div class="item">{/*
*/}<div class="label">Firstname</div>{/*
*/}<div class="field">{firstname}</div>{/*