I have 2 functions in a class, both class getting data from API calls.
Here is the First function
getQuotes(){
this.quoteService.getQuotes()
.subscribe(
quotes => {
this.quotCode = this.quotes.BasicDetails[0].QuotCode;
}
});
}
Second Function
getOption(){
this.quoteService.getOptions()
.subscribe(
options => {
})
}
I want to get data from this line from first function
this.quotCode = this.quotes.BasicDetails[0].QuotCode;
and based on this.quotCode getOption() will have different params to pass and will get diff. response also. so it is necessary to use this.quotCode in second function
I'm calling getQuotes() in constuctor()
Can anyone please help me out? Thanks