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

Resolve possible lambdas for partials #383

Closed

Conversation

leshill
Copy link
Contributor

@leshill leshill commented Dec 7, 2012

Hi @wycats,

I just ran across this today. We are using fairly complex context objects and wanted to invoke a partial with a context that was a function not a property. Let me illustrate with a completely contrived example. WIth this context:

{ first: function() { return this.data[0]}, data: [{name: 'Handlebars'}]};

And this partial invocation:

{{> partial first}}

The result for a simple partial of Name: {{name}} should be "Name: Handlebars".

This might resolve #182 and remove the need for #368

I am bummed that I missed the ember.js talk, if you are around Seattle tomorrow (Friday) I would like to buy you a coffee at Victrola on Pike (really great coffee).

An ID passed to a partial might be a property or a lambda. We need to check
for both when passing contexts into partials.
@leshill
Copy link
Contributor Author

leshill commented Dec 12, 2012

After using this for a while, I am closing this PR. This needs to be part of a larger change to handlebars.js or else it is confusing. The same result can be achieved with a helper, so we are switching our code to using a helper.

@leshill leshill closed this Dec 12, 2012
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.

1 participant