twitter / hogan.js

A compiler for the Mustache templating language
http://twitter.github.io/hogan.js
Apache License 2.0
5.14k stars 431 forks source link

Provide Better Documentation for Lambda Requirements #98

Closed scott-coates closed 11 years ago

scott-coates commented 12 years ago

I am using Cassette.NET to precompile Mustache templates on the server with Hogan. Cassette calls Hogan.Complie('...', { asString: true }) and a template instance is produced.

When I try to invoke these lambdas on the client, Hogan will not invoke the lambda function because the template instance mentioned above does not have the c (Hogan Complier), options, or text, properties set.

In regard to lambdas, the Hogan docs on GitHub simply state:

However, the optional lambda features from the Mustache spec do require the compiler to be present.

This is not the case, the template instance requires not only the compiler. It requires the options and original text to be set as well.

craigyk commented 12 years ago

I was curious about this as well from looking through the code- I couldn't tell if this was the case or not. It definitely reduces the usefulness of compiling and caching the renderers on the server and giving them to the client.

sayrer commented 11 years ago

https://github.com/twitter/hogan.js/commit/169f87193b3c2204dd8f4b5fdff37d65ec9767ab