Hi,
I mean, is it possible to call from an inner template a helper in the parent template or layout template?
If so, how?
Thanks
Hi,
I mean, is it possible to call from an inner template a helper in the parent template or layout template?
If so, how?
Thanks
You can’t directly share helpers between templates, but you can pretty easily create helpers as regular functions that can be assigned as helper functions to multiple templates.
export someFunc = function() {
//function code
}
import someFunc from '../path/to/someFunc.js';
Template.someTemplate.helpers({
someHelper: someFunc,
});
Have a look at this nice package: