Meteor .helpers 函数参数

Meteor .helpers function parameter

是否可以将参数从我的模板传递到 .helpers 函数参数?我正在尝试下面的代码,但我总是收到如下所示的错误。谢谢

Template.documentUpdate.helpers({

    getDocID: function(dCode){      
       return docsIDArray[dCode];
    }
});

在模板中:

<input type="hidden" id="docID" name="docID" value="{{getDocID(1) }}">

错误:

Exception from Tracker recompute function: Error: No such function: getDocID

你的语法不正确,试试这个:

<input type="hidden" id="docID" name="docID" value="{{getDocID 1}}">