2015-07-21 179 views
1

幫助我定義了一個路由器如下參數傳遞給模板對流星

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?! 
     } 
    }); 
} 

回答

3

裏面你Template.foo.helpers的,你可以通過搶路由器PARAMS:

Router.current().params.input

+0

工作,但不'的反饋query' –

+0

謝謝,我編輯我的迴應 –

相關問題