javascript - How Do I Use Spacebars Template Helpers to Prevent Need For Unnecessary Templates? -


i find myself doing lot:

{{> eventtitle}}  <template name="eventtitle">     {{eventtitle}} </template> 

is there way cut out template , do:

{{eventtitle}} 

then in js file:

template.eventtitle.eventtitle = function () {     return "title!"; }; 

you can use handlebars.registerhelper :

handlebars.registerhelper("eventtitle",function(){     return "title!"; }); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -