I am working on a class that contains two functions, both of which retrieve data from API calls.
Let's start with the First function
getQuotes(){
this.quoteService.getQuotes()
.subscribe(
quotes => {
this.quotCode = this.quotes.BasicDetails[0].QuotCode;
}
});
}
Next, the Second Function
getOption(){
this.quoteService.getOptions()
.subscribe(
options => {
})
}
I need to extract data from the line in the first function
this.quotCode = this.quotes.BasicDetails[0].QuotCode;
Based on the value of this.quotCode
, the getOption()
function will need to pass different parameters and receive different responses. It is crucial to utilize this.quotCode
in the second function.
I am calling getQuotes()
in the constuctor()
If anyone could provide assistance, I would greatly appreciate it. Thank you!