-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Access to property of other object in parent level #591
Comments
@uoziod In this case, I would pass the handlebars.registerHelper('doSomething', function(items, itemname) {
var item = items[itemname];
...
return 'something done';
});
Hope this helps. |
In this case I have another question: how to access to results of helper1 inside of helper2?) |
You can call helper1 from within helper2... Handlebars.registerHelper('helper2', function(input) {
// pass input to helper1 to do something
var output = Handlebars.helpers.helper1.call(this, input);
// do something else
var finaloutput = output;
return finaloutput;
}); There isn't a way to chain helpers within the markup/template syntax though. |
@doowb, great! Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have 2 objects coming to template:
Using {{#each}} helper I switching every foo's property. Inside of each we have use property contains text value of property in bar object that I want to use.
How can I get access to them?
Doesn't work.
The text was updated successfully, but these errors were encountered: