I'm struggling a bit on a common javascript issue, mostly because I don't know the key words to find the solution in Google. What I would like to do in pure javascript :
var obj = {label: 'Name', type: 'text', position: 0};
var name = 'label';
var temp = obj."name" // = obj.label = Name
And use it in meteorJS template :
data = [
{
"Name" : "Task 1",
"CreationDate" : ISODate("2014-06-03T19:47:48.252Z"),
"EndDate" : ISODate("2014-07-03T19:47:48.252Z")
},
{
"Name" : "Task 2",
"CreationDate" : ISODate("2014-06-04T19:47:48.252Z"),
"EndDate" : ISODate("2014-07-04T19:47:48.252Z")
}
}
columns = [
{label: 'Name'},
{label: 'Creation Date'},
{label: 'End Date'}
]
{{#each data}}
<tr>
{{#each columns}}
<td>{{data.label}}</td>
{{/each}}
</tr>
{{/each}}