Reputation: 9298
I want to run some code on the onCreated event in meteor in every template.
I know meteor allows helpers to apply to all templates:
Template.registerHelper("example", function() {
// do something
});
But is it possible to register a function that will apply to every onCreated event?
Upvotes: 3
Views: 154
Reputation: 64312
You need to use a package like template-extension:
meteor add aldeed:template-extension
Then you can do this:
Template.onCreated(function () {
// do something
});
Upvotes: 2