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

added 'include' helper for #182 #368

Closed
wants to merge 1 commit into from

Conversation

lwille
Copy link

@lwille lwille commented Nov 20, 2012

I added an "include" helper to allow passing of distinct objects down to the partial. Mainly inspired by @chickenwing and @ustun.
I did so after investigating into the structure of the compiler because I didn't see any obvious solution to reference the correct context (mainly due to missing knowledge about bison compilers in general).

Caveat: The helper only finds partials that are correctly registered and not passed in through compile options.

@lwille
Copy link
Author

lwille commented Nov 20, 2012

I don't really understand why travis tests something else than npm test, maybe somebody can help with the failing test.

It seems somehow related to runtime-only mode.

@kpdecker
Copy link
Collaborator

I'm sorry for not giving this any attention after being opened so long ago. The hash passing approach is a good one but this should be part of the core partials syntax as it avoids the caveat above and make this a proper first level implementation. I will provide an update on #182 implementing something to that effect.

@kpdecker kpdecker closed this Jan 17, 2014
jon-bell pushed a commit to FlakyTestDetection/handlebars-java that referenced this pull request Jul 21, 2017
this is the include helper as proposed in this pull request of the js
implementation: handlebars-lang/handlebars.js#368

the test case which accesses the parent context can't be run yet because the
parser will have to be modified and I'll need some help with that once I know
if this has a chance of being merged.
jon-bell pushed a commit to FlakyTestDetection/handlebars-java that referenced this pull request Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants