Search code examples
node.jsjquery-templatesexpress

how can i define variable in jqtpl-node


I using express js with jqtpl and i need to define temporary variable in jqtlp to keep some information from each loop. This is my try:

{{var tmp = ""}}
{{tmp = ""}}
${var tmp = ""}

Always my try doesn't work. How can i define variable? It's possibble ? Mybe not ?


Solution

  • You can define local variable by evaluating expression in template tag:

    ${( $local = 'Local variable' ),''}