参数传递给模板对流星
问题描述:
帮助我定义了一个路由器如下参数传递给模板对流星
Router.route('/profile/:input',function(){
this.render('profile');
});
这样我就可以得到input
调用this.params.input
的价值。我想在MongoDB上查询这个值并传递给模板Profile。但是我怎样才能将这些信息从路由器传递给帮助者?
if (Meteor.isClient) {
Template.profile.helpers({
data: function(){
//what to do?!
}
});
}
答
里面你Template.foo.helpers的,你可以通过抢路由器PARAMS:
Router.current().params.input
工作,但不'的反馈query' –
谢谢,我编辑我的回应 –