Created
June 18, 2013 08:43
-
-
Save i-like-robots/5803698 to your computer and use it in GitHub Desktop.
Handlebars helper to repeat a chunk of encapsulated output an arbitrary number of times.
This file contains 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
// {{#loop 12}} | |
// <output> | |
// {{/loop}} | |
handlebars.registerHelper('loop', function(count, options) { | |
var out = ""; | |
while (count--) { | |
out+= options.fn(); | |
} | |
return out; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment