Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Created November 8, 2011 01:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lukeholder/1346716 to your computer and use it in GitHub Desktop.
Save lukeholder/1346716 to your computer and use it in GitHub Desktop.
handlebars get index array by helper
Handlebars.registerHelper('get', function(context, block) {
return block(context[block.hash['index']]);
});
// Use it
{{#get people index="1"}}
{{name}}
{{/get}}
@simpleshadow
Copy link

This doesn't appear to work with 1.0.0-rc.3. Any idea how to get this working with rc3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment