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
$datathe data passed into template$importsvariable imported from outside and global variableprintstring-output functionincludesub-template loading functionextendtemplate-import function in template inheritanceblocktemplate-block declaration function