Hi All,
I am trying to set the value of a variable in a Meteor call callback. each time when it try i get
Exception in delivering result of invoking 'Transaction': TypeError: Cannot set property 'killjoy' of undefined
Transaction -Meteor Method
Killjoy is the variable.
This is how my code looks like
constructor(props){
super(props);
this.state={
killjoy:""
};
}
Meteor.call('Transaction', {}, function(err, response) {
if (err) {
// handle error
} else {
//console.log(response);
this.state.killjoy = response;
//console.log(variable);
}
});
I am expecting a response of the meteor call to be available globally for other function to follow.
can this be done ?