这应该很简单。
这就是我想要的:
Page 1 :订阅'列表'集合
第2页:显示来自'列表'的项目集合(用户然后从列表中选择一个项目,返回_id
)
Page 3 :订阅'数据'使用_id
进行收集 < - 在不使用铁路径的情况下,从现在开始,不使用铁路径
我已经与Template.subscribe
,Template.onCreated
等混淆了但是星期五,我确定这是基本的东西,所以我想我就是这样。问。
干杯!
答案 0 :(得分:0)
以下是我的表现:
userLayout
- >将currentPage
设置为
loading
强> currentPage
设置为userSplash
(否则将currentPage
设置为userProjects
,他们将选择一个项目然后转到userSplash
)
Template.userLayout.created = function() {
Session.set('currentPage', 'loading');
return Meteor.subscribe('projects', user.profile.company_id, function() {
if (currentProject_id !== void 0) {
return Session.set('currentPage', 'userSplash');
} else {
return Session.set('currentPage', 'userProjects');
}
});
};
Template.userSplash.rendered = function() {
return Meteor.subscribe('tasks', currentProject_id, function() {
return Session.set('currentPage', 'userDashboard');
});
};
(this回答提供了一些有用的信息)