Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Changing context in a Stache template breaks the data helper #1619
In the migration from EJS to Mustache, we lost the ability to explicitly declare which data was used with the data helper. For example, in EJS you could use:
In some cases, we rewrote the JS to expect the data to be the entire context, but in others, we worked around this limitation by changing the context in the template surrounding the usage of the data helper. For example:
Unfortunately, while upgrading to Stache, this broke due to an apparent bug that seems to put JS code into the DOM as exhibited by this fiddle.
So far, this seems to only be a problem with
Oh, I didn't realize that was supported. I could have sworn I tested this before and that it did not work... but it seems to be working fine now.
You should add that to the docs so people know it's available.
Edit: The only possible issue I can see is that if you do