vol4ok / hogan-express

Mustache template engine for express 3.x. Support partials and layout
MIT License
138 stars 31 forks source link

How to get the html from Hogan.Template() ? #17

Closed sackIndian closed 10 years ago

sackIndian commented 10 years ago

Hi,

Is there any method available to convert Hogan.Template() to html content?

Would like to trace back the properties of hogan.js.

Senario:

I compile {{{slot1}}}, and get the Hogan template as

templates.template = new Hogan.Template(function(c,p,i){var =this;.b(i=i||"");.b(.t(.f("1",c,p,0)));return .fl();;});

Now how can i conver templates.template to {{{slot1}}} ?

Thank in advance..

vol4ok commented 10 years ago

Hello,

If I understand you right, you just need to call it with arguments:

templates.template({slot1: "slot1 value"});


Have a nice day! Andrew Volkov

On 22.10.2013, at 15:36, sackIndian notifications@github.com wrote:

Hi,

Is there any method available to convert Hogan.Template() to html content?

Would like to trace back the properties of hogan.js.

Senario:

I compile {{{slot1}}}, and get the Hogan template as

templates.template = new Hogan.Template(function(c,p,i){var =this;.b(i=i||"");.b(.t(.f("1",c,p,0)));return .fl();;});

Now how can i conver templates.template to {{{slot1}}} ?

Thank in advance..

— Reply to this email directly or view it on GitHub.

sackIndian commented 10 years ago

kinda..