nested brackets in json template system, with objects
I'm using a json template with node. My json returns the follow:
garden = {
whichFruit: "orange",
fruit: {
orange: {color: "orange", shape: "circle"},
apple: {color: "red", shape: "round"}
}
}
So normally, I can just do this garden.fruit[whichFruit]
However in my json template I have:
{garden.fruit[{whichFruit}]}
which causes an error, I don't 开发者_JAVA百科think it likes the nested brackets?
Is there anyway around this?
精彩评论