Why helpers are registered in 2 different ways?


Why helpers are registered in 2 different ways in the following example?


No idea.

You may have already worked out that it doesn’t matter. In fact, they are the exact same function. If you compare them in the console you get:

> Handlebars.registerHelper === UI.registerHelper
<- true

In fact they are all the same:

> Template.registerHelper === Blaze.registerHelper && Blaze.registerHelper === UI.registerHelper && UI.registerHelper === Handlebars.registerHelper && Handlebars.registerHelper === Template.registerHelper
<- true


Interesting hehe. Both “UI” and “Handlebars” are just there for backwards compatibility. That demo you’re looking at is very old.

“Template.registerHelper” is what you’re supposed to use according to the docs, but “Blaze.registerHelper” is the original :stuck_out_tongue:


Any complete demo with public repo you can suggest that is more up to date ?


The todo apps from the turorials should probably be up to date I think.
Althought the Blaze app hasn’t actually been updated in 2 years…