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? -

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

ajax - PHP/JSON Login script (Twitter style) not setting sessions -