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

Further clarification would be helpful on the 'Expressions' subpage, under the 'Helpers' section #142

Open
j-g-v-d opened this issue Feb 18, 2016 · 0 comments

Comments

@j-g-v-d
Copy link

j-g-v-d commented Feb 18, 2016

First off - thank you for creating such an incredible library! I just had some minor pieces of feedback - that might help people adopt Handlebars quicker.

On this page, under the Helpers section, on the final example.

From my understanding of the documentation (please correct me if I'm wrong), but it appears that the second parameter 'options' in the helper registration function is a wrapper for all hashed parameters passed in. This means that, for the example below (from my understanding)
{{{link "See more..." href=story.url class="story"}}}
corresponds to:
Handlebars.registerHelper('link', function(text, options)...
where here, _text _= "See more..." and _options _= {href:"", class:"story"}. Are these object values here correct?

Is my understanding here correct? If not, could the documentation be updated to reflect what it should be? If my understanding here is correct, could the documentation be updated to make this more clear (this isn't immediately obvious)? Also, perhaps a caveat could be added, explaining why you couldn't simply pass in an 'options' JavaScript object, rather than key-value pairs of hashes (href="google.com" vs. {href:"google.com"})?

Thank you for all of the effort put in here!

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

No branches or pull requests

1 participant