Open spadkins opened 8 years ago
@spadkins This module is no longer maintained (as far as I can tell), but I've migrated it here and published it as hogan-xpress
and incidentally, this issue is fixed there . . . or should be. If it's not, feel free to open an issue there.
I declare my lambdas to have two arguments, the enclosed text and the set of options/variables. e.g. See at the bottom for two examples. However, while the "text" is passed ok, the "ctx" is always undefined. In this state, lambdas are much less useful than they could be. I copied the module and made the following change, and it works perfectly for me. May I suggest that the change is made in the sources? (As it is, I am using the modified version of hogan-express.js in my project.)
hogan-express.coffee (line 85) OLD: return lambda(hogan.compile(text).render(lctx)) NEW: return lambda(hogan.compile(text).render(lctx), lctx)
hogan-express.js (line 131) OLD: return lambda(hogan.compile(text).render(lctx)); NEW: return lambda(hogan.compile(text).render(lctx), lctx);