如何将文档对象传递给下一个视图,流星离子
How to pass document object to next view, meteor ionic
如何将当前查询的文档对象传递到下一个视图,而不必再次查询 mongo。我意识到我可以传递 Id 和一些任意变量,但我如何传递整个对象?
您可以在您的 "waitOn function" 路线中订阅数据,例如:
this.route('dashboard', {
path: '/dashboard',
layoutTemplate:'mainLayout',
waitOn:function(){
Meteor.subscribe('collection1');
Meteor.subscribe('collection2');
return Meteor.subscribe('collection3',Meteor.userId());
},
data:{
'collection3':function(){
return collection3.find();
}
},
在您的 publications.js 中,您可以控制通常传递给客户端的内容。
如何将当前查询的文档对象传递到下一个视图,而不必再次查询 mongo。我意识到我可以传递 Id 和一些任意变量,但我如何传递整个对象?
您可以在您的 "waitOn function" 路线中订阅数据,例如:
this.route('dashboard', {
path: '/dashboard',
layoutTemplate:'mainLayout',
waitOn:function(){
Meteor.subscribe('collection1');
Meteor.subscribe('collection2');
return Meteor.subscribe('collection3',Meteor.userId());
},
data:{
'collection3':function(){
return collection3.find();
}
},
在您的 publications.js 中,您可以控制通常传递给客户端的内容。