2017-01-16 18:30:54 +01:00
|
|
|
import { Blaze } from 'meteor/blaze';
|
|
|
|
|
import { _ } from 'meteor/underscore';
|
|
|
|
|
|
|
|
|
|
Blaze.registerHelper('objectToPairs', function(object) {
|
2016-05-07 08:58:46 +02:00
|
|
|
// http://stackoverflow.com/questions/30234732/how-to-print-key-and-values-in-meteor-template
|
|
|
|
|
return _.map(object, function(value, key) {
|
|
|
|
|
return {
|
|
|
|
|
key: key,
|
|
|
|
|
value: value
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
});
|