I have an Article, object witch contains array of Translations. And translations contains array of Subjects.
const article = {translations:[ {translationId:"0", subjects:[...] }, {translationId:"1", subjects:[...] }, ...]
And I’m trying to write data from sub-template TagSubjects to parent template Article (into nested array witch is explained above).
{{#each tr in article.translations}}
...
{{> TagsSubjects}}
...
{{/each}}
In that way , I have full access to parent Template instance, and I can write from TagsSubjects.js (just for testing) data like this:
template.data.translations[0].subjects.push(tagId)
And this data will be displayed and saved in Article.
But I don’t know how to pass translationId.
When I do
{{> TagsSubjects translationId=tr.translationId}}
or
{{> TagsSubjects translation=tr}}
I lose access to parent template Article.
How can I access to translationId from template.data in case of passing whole parent context to sub-template.
Or how can I access to parent template instance , after passing translationId to sub-template?
I tried use callback, but it didn’t help me (may be I did something wrong).
I’ve read this article from docs:
http://blazejs.org/guide/reusable-components.html