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

前端 未结 5 1837
无人共我
无人共我 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条回答
  •  执笔经年
    2020-12-25 10:36

    I've just accidentally discovered this in the console:

    Template.registerHelper
    function (name, func) {                                                                             
      Blaze._globalHelpers[name] = func;                                                                                   
    } 
    

    So, Blaze._globalHelpers is what we are looking for!

提交回复
热议问题