开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜