Meteor, how to access to a helper from another helper?

前端 未结 5 1848
无人共我
无人共我 2020-12-25 09:52

I have a helper like

Template.user_profile.helpers({
  user:function() {
     return Meteor.users.find({\'profile.front_name\':Session.get(\'slug\')}).fetch(         


        
5条回答
  •  Happy的楠姐
    2020-12-25 10:46

    You can call a template helper (not global helper - which is in outluch's answer) with:

    Template.tplName.__helpers.get('helper').call()
    

    MDG suggests using a regular function and then passing it to helpers, events and so on. See here.

    Update 16.06.16
    Actually I strongly advise to simply use manuel:viewmodel - it alleviates so many Blaze headaches...

提交回复
热议问题