You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm having an issue while trying to pass a parameter to a function inside a snippet from another file. I'm running the latest version of doT. This is a small example of what I'm doing:
This is the template that calls the snippet and its function:
<!-- template.def -->
{{#def.snippet}}
{{ some_variable = {"foo": "bar"}; }}
{{# def.testFn(some_variable) }} // prints "some_variable" as string instead of `some_variable` actual value
I've also tried {{# def.testFn({{= some_variable}}) }} but I get a similar result - it just prints {{= some_variable}}
The behavior that I'd expect is being able to pass a runtime variable value to the compiled def.testFn, instead of its name as string, as shown here@124.
The text was updated successfully, but these errors were encountered:
Hi everybody!
Currently I'm having an issue while trying to pass a parameter to a function inside a snippet from another file. I'm running the latest version of doT. This is a small example of what I'm doing:
Snippet that declares the function and param:
<!-- snippet.def --> {{## def.testFn = function (anything) { console.log(anything); }}
This is the template that calls the snippet and its function:
<!-- template.def --> {{#def.snippet}} {{ some_variable = {"foo": "bar"}; }} {{# def.testFn(some_variable) }} // prints "some_variable" as string instead of `some_variable` actual value
I've also tried
{{# def.testFn({{= some_variable}}) }}
but I get a similar result - it just prints{{= some_variable}}
The behavior that I'd expect is being able to pass a runtime variable value to the compiled
def.testFn
, instead of its name as string, as shown here@124.The text was updated successfully, but these errors were encountered: