0
我已經發布了countries
收藏品,我想在countriesList
模板的表格中展示。所以,我已經加入這個路由器:收藏夾沒有顯示在頁面
Router.route('/countries_list', {
name: 'countriesList',
waitOn: function() {
return Meteor.subscribe('countries');
},
data: function() {
return Countries.find();
}
});
這是模板的樣子:
{{#each countries}}
<tr>
<td>{{name}}</td>
</tr>
{{/each}}
但頁面保持爲空。然而,收集填充在客戶端上,如果我檢查瀏覽器控制檯,並做Countries.findOne();
,我得到這樣的結果:
Object {_id: "WWJhMBne4CiEdbbdg", name: "England"}
那我錯在這裏做什麼?
也許你的路線不等待訂閱,得到同樣的問題幾個主題較低 – Sindis 2014-11-20 19:42:04