AnsweredAssumed Answered

Use value returned from a function in another function

Question asked by Sarika Tandale on Jan 29, 2018
Latest reply on Feb 2, 2018 by Sarika Tandale

Hello,

 

I am new to backbone. Can anyone please explain how to use the value returned by one function in another function?

 

This is the pseudo code :

 

({
extendsFrom: 'RecordView',

initialize: function(options) {
this._super('initialize', [options]);
this.context.on('button:get_tax:click', this.get_tax, this);
this.model.addValidationTask('addressValidation', _.bind(this.save_button, this));


},


save_button: function(fields, errors, callback) {

use the value of 'currentTax' variable
},

get_tax: function() {

var currentTax = this.model.get('taxrate_name');
return currentTax;

}
})

 

Thank you

Outcomes