How can I enable settings.allowCode(true) for jsrender
-
I need to be able to assign variables in the jsrender and it appears this doesn't work out of the box with jsreport.
-
hmm can you show what are you trying in playground? so far i see that
settings.allowCode
api is forjsViews
, which is something that only works in browser, and not in server side templates (which jsreport uses), so i'm not sure that you can do the same using the same api
-
I'm trying to assign a result of a function call that otherwise would be called like so:
{{:~ func(abc)}}
to a variable that I'd like to reuse later like this:{{: ...}}
-
I am also looking for use of this as described https://www.jsviews.com/#allowcodetag@sample
-
You can call
allowCode
at the top of your helpers.var jsrender = require('jsrender') jsrender.views.settings.allowCode(true);