在我的离子应用程序中,我观看了一个firebase路径“游戏”,它被复制到我的本地变量currentGame中。 示例路径:
FirstSecondThird
Fourth
FifthERROR: SixthERROR: Seventh
Eighth
Press any key to continue...
我将有多达10轮。 我该怎么做
this.gameProvider.currentGame.round2.character4.somevalue
答案 0 :(得分:0)
gameProvider = {currentGame:{}}
for (i=1; i<10; i++) {
this.gameProvider.currentGame['round' + i ] = {character4: {somevalue: 'asdf'}};
}
for (i=1; i<10; i++) {
console.log(this.gameProvider.currentGame['round' + i ].character4.somevalue);
}
&#13;