Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global function for Meteor template helper

Tags:

meteor

I have registered a global function like this:

Handlebars.registerHelper('dialogBoxOptions', function (callbackFunctionName){
    return {
        callBack: callbackFunctionName
    };
});

but when I try to access it as below I get dialogBoxOptions is not defined

Template.myLlist.helpers({
    dOpt: dialogBoxOptions('dlgCB')
});

I have tried this as a global handlebars helper and a regular javascript function but get the same result.

like image 576
A_L Avatar asked Dec 19 '13 12:12

A_L


1 Answers

Use Template.registerHelper(name, function)
As shown in Meteor Documentation

like image 160
Abdullah Dahmash Avatar answered Sep 28 '22 23:09

Abdullah Dahmash