I’m interested in the fastest way to get first template’s data context in the third template.
Using “templating system” in html file: {{> TemplateThree data=…/… }}
Using “helper system” TemplateThree.helpers({ data: func() {return Template.parentData(2)}
How do you think, what way is the fastest? Or may be you can advice something else?
Thanks
update: I have even more complex structure now. For example, I need data from Template.parentData(13).
How do you think, can it cause some performance issues?
That’s a great question! I’m having the exact same doubt, but I’m having an issue before which is actually getting the parentData to the nested templates.The code runs with no errors but the expected result does not occur.
Can you give you look at this code of mine and tell me what I’m doing incorrectly?
It’s not working for me. No data is passed to my nested helper. I tested with alerts to see if any data was being passed to the nested template and I get ‘null’ everytime.
Seems to me this is related to this meteor bug with Template.instance(): https://github.com/meteor/meteor/issues/4035
However it seems it works for you two… how exactly is the question.