0
好吧,所以我對流星很陌生並且有一些複雜的數據結構設置。 假設我被迫保持結構我的模板需要看起來像什麼才能顯示這個結構?難道我做錯了什麼?我似乎無法讓我的當前代碼正常工作。任何幫助或建議非常感謝! -Thanks如何在meteor/blaze/spacebars中嵌套對象和數組迭代
這裏是我的數據結構:
Tournament: {
round1:{
match1:[
{ToqeLokbLAs9mALd3: {win: true, gamertag: 'gbachik'}},
{scH8Zb3XMa5ALZNsL: {win: false, gamertag: 'test'}}
],
match2:[
{c4LQoXGEo6dA8ZtNT: {win: false, gamertag: 'test2'}},
{TDrZa3QY3AinxXw5D: {win: true, gamertag: 'test3'}}
]
},
round2:{
match3: [
{ToqeLokbLAs9mALd3: {win: true, gamertag: 'gbachik'}},
{TDrZa3QY3AinxXw5D: {win: false, gamertag: 'test3'}}
]
},
consolation:{
match1: [
{scH8Zb3XMa5ALZNsL: {win: null, gamertag: 'test'}},
{c4LQoXGEo6dA8ZtNT: {win: null, gamertag: 'test2'}}
]
}
}
我的助手:
Template.index.helpers({
round: function(){
return Tournaments.findOne({});
}
});
我的路線:
Router.route('/', function() {
this.subscribe('tournaments').wait();
this.render('index');
});
我的靜態視圖(玉):
.tournament
ul.round1.of3
li
.participant.winner
a(href='#')
span.participant-title= this
span.participant-number 2
.participant
a(href='#')
span.participant-title asdasd loser
span.participant-number 3
如果您可以包含一些關於如何顯示錦標賽數據的信息將會有所幫助。 – 2014-11-08 22:40:06
以下是基本思想[visual](http://cl.ly/image/3G2N0n2Q1724) – gbachik 2014-11-09 05:45:03