cassette icon indicating copy to clipboard operation
cassette copied to clipboard

Hogan Template Not Given Enough Info To Invoke Lambdas

Open scott-coates opened this issue 12 years ago • 2 comments

In the HoganCompiler, the stringified functions created by calling: return Hogan.compile(template, { asString: true });

This populates a Hogan.Template instance. This instance only has the r functions set from the aforementioned step. However, the c property (a reference to Hogan.Complier), the text property (the original string), and the options aren't provided.

Calling Hogan.Complie on the client will property set all of this for you, but it obviously defeats the purpose of precompiling on the server.

scott-coates avatar Aug 05 '12 07:08 scott-coates

What's the correct way to compile the template server side?

Can you update https://github.com/andrewdavey/cassette/blob/v2/src/Cassette.Hogan/HoganCompiler.cs and send me a pull request please?

andrewdavey avatar Aug 22 '12 17:08 andrewdavey

Has there been an update regarding Hogan and Lambdas? I'm currently struggling to find a way to get around this and can't seem to find a viable solution without including the source files, which would obviously make the precompiler pointless.

I'm currently experimenting with using sectionTags in the compile call, but that doesn't really seem to do the trick.

jpsullivan avatar Jan 29 '13 22:01 jpsullivan