Meteor .helpers function parameter
Asked Answered
T

1

5

Is it possible to have pass a parameter from my template to a .helpers function parameter? I am trying the code below but I am always getting the error shown below. Thanks

Template.documentUpdate.helpers({

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

in template:

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

Error:

Exception from Tracker recompute function: Error: No such function: getDocID
Tighe answered 2/4, 2015 at 11:1 Comment(0)
K
8

Your syntax is incorrect, try this :

<input type="hidden" id="docID" name="docID" value="{{getDocID 1}}">
Kate answered 2/4, 2015 at 11:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.