Skip to content

Data moved to parent template #10

Description

@JobJob

This is going to be hastily reported, sorry in advance, let me know if you need more details.

In my routes:

this.render("toptemplate",{data:{info1: "hi", info2: 7}})

Template:

<template name="toptemplate">
  {{#dynamicTabs name="app_sections" tabs=tabs }}
     {{ahelper}}
     {{#tabContent slug="tab1"}}
     tab1 
     {{/tabContent}}
  {{/dynamicTabs}}
</template>

toptemplate.js:

Template.toptemplate.helpers({
  ahelper: function(){
    console.log(Template.currentData().info1) //undefined
    console.log(Template.parentData().info1) //"hi"
  }
})

I guess it should be documented that the template's data is moved to parentData() under those circumstances. It was unexpected for me and took me a bit of time to work out what was wrong.
Great lib btw - cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions