blaze-tabs
blaze-tabs copied to clipboard
Data moved to parent template
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!
Thank you for your comment. I just lost a couple of hours wondering where was my data.
:+1:
Hi there--I've been a little slow with my projects the past week because I'm traveling for work. I'll be sure to update the docs as soon as I have some time to properly go through this.