问题
I am using rxjs forkjoin to make multiple http request. forkjoin takes 7 parameters To the existing code, i just adding new observable. but for some reason it is throwing error which is really weird. Here is the existing code:
const countries = this.referenceDataApiService.getLoadAndDischargeCountries();
const currencies = this.referenceDataApiService.getCurrencies();
......
forkJoin([countries, currencies,..,..,..,..,xxx]).subscribe((results) => {
this.countries = results[0] ? results[0].sort() : [];
this.currencies = results[1] ? results[1].sort() : [];
...removed rest of code for brevity
}
The above code works fine and when i mouse over results, it shows the pipe separated array for countries and currencies. As soon as i add new observable to the list, i am getting error saying 'The property 'sort' does not exist on type.....
Code i am adding is:
const trades = this.referenceDataApiService.getTradeTypes();
forkJoin([countries, currencies, trades]).subscribe((results) => {
Can anyone help me what am i doing wrong here?
thanks
来源:https://stackoverflow.com/questions/60434304/angular-7-rxjs-forkjoin-unable-to-add-new-observable-to-the-existing-list-ie-mo