How to render handlebar code and not show as text



  • If I have text in database with handlebar code how can i make it render in template. I am using chrome pdf recipe.

    on or before 11:00 a.m. on\n{{#if ntc.bidOpen}}\n<span class=\"text-underline\">{{ntc.bidOpen}}.</span>\n{{else}}\n<span class=\"text-underline\">___Add Date here__________________.</span>\n{{/if}}

    how can handlebar part be executed - right now it spits out as a text.



  • Write your own helper that will evaluate handlebars code
    Something like this

    function evaluate() {
        return Handlebars.compile('{{#if true}}hello{{else}}nothing{{/if}}')(this)
    }
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.