I am new to meteor, and am struggling with using #each
in blaze.
I tried following this answer on stackoverflow, but my requirement is slightly different.
I have a json object array:
{
"accounting": [{
"firstName": "John",
"lastName": "Doe",
"age": 23
},
{
"firstName": "Mary",
"lastName": "Smith",
"age": 32
},
{
"firstName": "Mike",
"lastName": "Nolan",
"age": 21
}
]
}
How do I display firstName from each object, using blaze (specifically using #each to iterate the array) in a meteor project.
I tried a lot of different ways, using multiple helper methods, but am not able to make it happen. If someone can please help.
Also, if it is not possible, please tell alternatives to achieve the same.
The data is coming from an API call, and the format of data is a json object, but is stored as a Session variable (so that's where I will be getting it from in the helper method, using Session.get()
).