0

ノードでjsonテンプレートを使用しています。私のjsonは次を返します:

garden = {
   whichFruit: "orange",
   fruit: {
     orange: {color: "orange", shape: "circle"},
     apple: {color: "red", shape: "round"}
   }
}

通常、この garden.fruit[whichFruit] を実行できます。

ただし、私のjsonテンプレートには次のものがあります。

{garden.fruit[{whichFruit}]}  

エラーが発生します。ネストされたブラケットが好きではないと思いますか?

とにかくこのあたりはありますか?

4

0 に答える 0