Questions tagged [meteor-helper]

Template helpers in Meteor define values or functions that can be accessed from Meteor's logicless Spacebars templates.

In , each template has a local dictionary of helpers that are made available to it:

Template.myTemplate.helpers({
  foo: function () {
    return Session.get("foo");
  },
  bar: 'baz'
});

To define helpers available globally throughout your app, use Template.RegisterHelper.

301 questions
58
votes
2 answers

How to use multiple parameters in a handlebar helper with meteor?

I am trying to create a custom helper using Meteor. Following to the doc here: https://github.com/meteor/meteor/wiki/Handlebars I have tried to define my helper as follows: Template.myTemplate.testHelper = function(foo, bar, options) { …
Greg
  • 591
  • 1
  • 4
  • 3
22
votes
8 answers

Meteor: Access Template Helper (or variable) from another helper

How can I reference a template helper from another one? For example... Template.XXX.helpers({ reusableHelper: function() { return this.field1 * 25 / 100; //or some other result }, anotherHelper: function() { if…
Habib
  • 279
  • 1
  • 2
  • 9
17
votes
2 answers

event.target is undefined in events

How can one use each input values in events? Hope my below code will explain you well. HTML: