Table of Contents
New Syntax
New template syntax has features for
- Value:
{{A_Field_In_Data}}
- Multiple dots to access is allowed.
- Complex cases, use
js:prefix eg.
{{js:CODE_TO_EVAL}}
- Use
_Con.method_name if needed to call a method in controller
- If: An attribute in element
if
- For: An attribute in element
for
for="Varname: Any JS for-clause"
- Access _index, or field name of that var by Varname
- ⚠️Warn: Only inside the tag with attribute ‘for’, the field values are accessible, not right at the tag containing attribute ‘for’.
- For-key: An attribute in element
for-key
for-key="Key/Obj: let Key in Obj"
- Access Key, or Val, for Val.Field_Name
- Component: An attribute in element
com
<div com="component-name"></div>
- Call method
- Eg.
onclick="method:some_method_in_controller"
Each element can have only either of: if, for, for-key, com