Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #429 - support .js views with functions. #717

Merged
merged 6 commits into from Sep 13, 2019

Conversation

JEStaubach
Copy link
Contributor

Allows functions to be passed in views by allowing javascript files instead of only JSON files.

@phillipj
Copy link
Collaborator

phillipj commented Sep 5, 2019

Thanks a lot for this contribution! 💯

Any plans or thoughts for testing this? It's important we know this works as expected, both currently and going forward when doing future improvements.

@JEStaubach
Copy link
Contributor Author

I should be able to make that happen. Since #429 referenced having an issue with the bold example in the readme section that sounds like a good test to start with.

Tests janl#717 for cli which allows use of functions in a view which is
exported javascript.
bin/mustache Outdated Show resolved Hide resolved
bin/mustache Outdated Show resolved Hide resolved
@phillipj
Copy link
Collaborator

Great getting a test in place 👍 Other than a naming nitpick, this LGTM.

JEStaubach and others added 2 commits September 12, 2019 19:46
Co-Authored-By: Phillip Johnsen <johphi@gmail.com>
@phillipj phillipj merged commit 13cde04 into janl:master Sep 13, 2019
@phillipj
Copy link
Collaborator

Published in v3.1.0.

@ph1-xyz
Copy link

ph1-xyz commented Mar 18, 2020

Allows functions to be passed in views by allowing javascript files instead of only JSON files.

Hi @JEStaubach!
I'm a newcomer to mustache and to development in general. I managed importing my JSON as js, including it into a variable. But...

Does that changes the way entries should be passed to Mustache? I included my json in a variable, but it seems now mustache doesn't find the array where values are stored to be substituted in the template. I tried doing

{{#variable.arrayName}}
{{item}}
{{/variable.arrayName}}

But that didn't work.

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants