You can use Handlebars.registerHelper just like this :
Handlebars.registerHelper("eventTitle",function(){
return "Title!";
});
Question
I find myself doing this a lot:
{{> eventTitle}}
<template name="eventTitle">
{{eventTitle}}
</template>
Is there a way to cut out the template and just do:
{{eventTitle}}
Then in the js file:
Template.eventTitle.eventTitle = function () {
return "Title!";
};
La solution
You can use Handlebars.registerHelper just like this :
Handlebars.registerHelper("eventTitle",function(){
return "Title!";
});
Autres conseils
In Meteor 1.0 use Template.registerHelper(name,function) to register a global template helper.