Zach Smith
Zach Smith

Reputation: 8961

Meteor: why are template events available to 'sub-templates', but template helpers not?

If I have the following page structure:

<users template>
  <user template/>
  <user template/>
</user template>

Why is it that I can access Template.users.events({}) from within the <user template/>, but not Template.users.helpers({})?

I wish I could access helpers from 'holder' templates

Upvotes: 0

Views: 129

Answers (1)

JeremyK
JeremyK

Reputation: 3240

Take a look at Template.registerHelper, this provides a way to create helpers that can be used across all templates.

Template.registerHelper

Parent events are triggered due to how events bubble up in javascript.

Upvotes: 2

Related Questions