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

Add support for passing hash parameters to partials #93

Merged
merged 2 commits into from Jan 29, 2016

Conversation

amaclean
Copy link
Contributor

This library is awesome, but I really wanted to be able to pass a bunch of parameters to a partial that were not in the root context (http://handlebarsjs.com/partials.html#partial-parameters).

I've added a new HashParameters expression that contains a collection of key value pairs (string, object) to achieve this. It supports the value being a string, int, bool or a context path.

e.g. {{>person pie=1 foo=true bar="hello" name=leadDev.name }}

I didn't have a massive amount of time to spend but I have written a bunch of unit tests and everything looks good.

Let me know what you think.

@simmo
Copy link

simmo commented Jan 28, 2016

+1 👍 This would be an excellent addition! Nice work @amaclean

@rexm
Copy link
Member

rexm commented Jan 29, 2016

Looks great... thanks for the PR

rexm added a commit that referenced this pull request Jan 29, 2016
Add support for passing hash parameters to partials
@rexm rexm merged commit b201c0a into Handlebars-Net:master Jan 29, 2016
@rexm
Copy link
Member

rexm commented Jan 29, 2016

Updated NuGet 1.6.0

@rexm rexm mentioned this pull request Jan 29, 2016
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