I need to check in a child template the value of a reactive dict variable, which was created in the parent template.
<template name="parent">
{{ > child }}
</template>
<template name="child">
{{#if something}}
checked
{{/if}}
</template>
This is how I initialize a reactive dict variable to the parent template:
Template.parent.onCreated(function() {
this.blabla = new ReactiveDict();
});
So for the parent template this helper is working:
Template.parent.helpers({
anything: function(type) { return (Template.instance().blabla.get('foo') === 'bar') ? true : false; }
});
But it won't work for the child:
Template.child.helpers({
something: function() { return (Template.instance().blabla.get('foo') === 'bar') ? true : false; }
});
So how can I check the value of the variable in the child helper?