Skip to content

Instantly share code, notes, and snippets.

@sclausen
Created July 3, 2014 06:42
Show Gist options
  • Save sclausen/7c655d0a99c0a434e066 to your computer and use it in GitHub Desktop.
Save sclausen/7c655d0a99c0a434e066 to your computer and use it in GitHub Desktop.
Template.foo.helpers({
data1: function(){
var array = [];
var storedData = Session.get("data");
//underscore
_.each(Object.keys(storedData),function(key){
array.push(storedData[key]);
});
return array;
},
data2: function(){
var array = [];
var storedData = Session.get("data");
//lodash
_.forIn(storedData, function(key){
array.push(storedData[key]);
});
return array;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment