How to create a function for all the templates in meteor?
index.js
// Some function
function somefunction(){
return true;
}
Test1.js
Template.Test1.events({
'click button' : function (event, template){
//call somefunction
}
});
Test2.js
Template.Test2.events({
'click button' : function (event, template){
//call some function
}
});