Ho un modello con alcuni modelli annidati in Meteor:Get reattiva var da un altro modello nella Meteor
<template name="collectingTmpl">
{{> firstTmpl}}
{{> secondTmpl}}
</template>
Se ho impostato un reattivo var/dict in firstTmpl
con
Template.firstTmpl.events({
'click .class-name': function(event, template) {
template.state = new ReactiveDict;
template.state.set('someName', 'someValue');
}
});
posso ottenere questo valore all'interno dello stesso modello con
Template.firstTmpl.helpers({
myValue: function() {
Template.instance().state.get('someName');
}
});
ma posso anche recuperare il valore impostato in firstTmpl
da secondTmpl
?
voglio dire una cosa del genere
Template.secondTmpl.helpers({
myValueFromAnotherTmpl: function() {
Template.firstTmpl.state.get('someName');
}
});