Skip to content

Instantly share code, notes, and snippets.

View JosephSilber's full-sized avatar

Joseph Silber JosephSilber

View GitHub Profile
@JosephSilber
JosephSilber / handlebars.object_helpers.js
Created October 3, 2012 20:34 — forked from strathmeyer/handlebars.object_helpers.js
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, options) {
var buffer = "",
key;