<div>
<em>Name:</em> {{:name}}
{{if showNickname && nickname}}
(Goes by <em>{{:nickname}}</em>)
{{/if}}
</div>Example:
onclick="showCallMeModal({{:#parent.parent.data.parentVariableName}})"Dot.notation!
<script id="personTmpl" type="text/x-jsrender">
{{if nickname}}
Nickname: {{:nickname}}
{{else name}}
Name: {{:name}}
{{else}}
No name provided
{{/if}}
</script>They are multi-line!
{{!-- <div>
</div>
--}}{{:index}} contain the index number
{{for myArray}}
...
{{:#index}}
...
{{/for}}You can sort elements!
{{for array sort="firstName" }}...{{/for}}pay caution to sub variables!
es:
{{for array sort="com.asd.firstName" }}...{{/for}}example: "if is the first index then ..."
{{if #index == 0}}...{{/fi}}VERY VERY IMPORTANT
VARIABLES INSIDE FOR HAVE THEY OWN CONTEXT
SO IF YOU WANT TO ACCESS A VARIABLE OUTSIDE THE FOR, YOU HAVE TO USE THIS SYNTAX
{{for items}}
{{if #parent.parent.data.variableOutsideTheFor)}}{{:#index}}{{/if}}
{{/for}}VERY VERY IMPORTANT
SAME THINGS FOR EVERY CODE BLOCK, IF BLOCK TOO!!!
Use this kind of trick:
{{:"<"}}script type="text/javascript">
alert('1');
{{:"<"}}/script>- variable undefined even if you know it exists? take a look to the
parentnotation here