Answer the question
In order to leave comments, you need to log in
How to cancel a request to receive data?
I have a data loading method in the service
getSpend(months : number[]) {
return this.http.get("assets/fake/fake-report-spend.json")
.map((data: Response) => data.json().data)
.concatMap((array) => Observable.from(array))
.filter((data: {month: number, spend: number}) => months.indexOf(data.month) != -1)
.catch((error : any) => Observable.throw(error))
.delay(2500);
}
this.reportService.getSpend(this.selectedMonthsKeys)
.subscribe(
data => {
this.data.push(data.spend);
},
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question