好的,所以我是流星新手,并且数据结构设置有些复杂。假设我被迫保留结构,我的模板需要是什么样子才能显示它?难道我做错了什么?我似乎无法让我当前的代码工作。非常感谢任何帮助或建议!-谢谢
这是我的数据结构:
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