Closed vjau closed 9 years ago
We're using it internally only with React but you're right, we should provide a Blaze example as well.
About helpers and events, you should be able to do (based on basic app you get with meteor create
):
helpers.import.js:
export let helpers = {
counter: function () {
return Session.get('counter');
}
};
export let events = {
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
};
someFile.js:
System.import('helpers').then(function (module) {
Template.hello.helpers(module.helpers);
Template.hello.events(module.events);
});
I just checked and everything is working as intended :)
Does this answer satisfy you?
That make sense, thank you :)
Ok, closing for now. I will keep in mind that Blaze examples should be in the new docs that are coming soon.
Hi, could you please create a demo app using blaze, or show us some code snippets of the key techniques to do it ? How are you supposed to export/import template helpers, i can't get this to work.
Thank you in advance