template.defaults.imports
Template can access global variable outside it and imported variable through $imports
.
Import variable
template.defaults.imports.log = console.log; |
<% $imports.log('hello world') %> |
Built-in variable
$data
the data passed into template$imports
variable imported from outside and global variableprint
string-output functioninclude
sub-template loading functionextend
template-import function in template inheritanceblock
template-block declaration function