Created
November 8, 2011 01:02
-
-
Save lukeholder/1346716 to your computer and use it in GitHub Desktop.
handlebars get index array by helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('get', function(context, block) { | |
return block(context[block.hash['index']]); | |
}); | |
// Use it | |
{{#get people index="1"}} | |
{{name}} | |
{{/get}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't appear to work with 1.0.0-rc.3. Any idea how to get this working with rc3?