Get label for AutoForm option value in Meteor Simple Schema -


in meteor template {{parameter}} returns value of option schema:

new simpleschema({   parameter: {     type: string,     allowedvalues: ['value_1', 'value_2'],     autoform: {       options: [         {label: "label_1", value: 'value_1'},         {label: "label_2", value: 'value_2'}       ]     }   }, }); 

how can label instead of value in template?

template.yourtemplate.helpers({   label: function (value) {     return _.findwhere(yourschema.schema('parameter').autoform.options, { value: value }).label;   } }); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -