As the title suggests, I am looking for the difference in usage of the above helper creation functions with Ember.js.
Helper (From Ember.js API Docs):
helper (name, function, dependentKeys)
Register a bound helper or custom view helper.
Example:
Ember.Handlebars.helper('capitalize_h', function(value) { return value.toUpperCase(); });RegisterHelper (From Handlebars.js):
Example:
Handlebars.registerHelper('capitalize_rh', function(value) { return value.toUpperCase(); });RegisterBoundHelper (From Ember.js API Docs):
Example:
Ember.Handlebars.registerBoundHelper('capitalize_rbh', function(value) { return value.toUpperCase(); });
From using the 3, I found that :
Ember's helpers (helper & registerBoundHelper) can also work on a model's property,
For example:
Assuming that model has property name with value 'Vageesh', so the following will provide the same result, i.e., 'VAGEESH':
{{ capitalize_h name }}And
{{ capitalzie_rbh name }}But, Handlebars 'register helper' will not work in the above way, i.e., result will be 'NAME':
{{ capitalize_rh name }}
So, are there any other differences in usage or is this the only difference?
Also, which helper creation method is advised under what circumstances?