1 year ago

#269040

test-img

May

.toPromise().then(...).catch(...).finally is not a function

I'm getting this error on Firefox and I'm using rxjs 6.5.4 version:

Unhandled promise rejection TypeError: this.service.getPastData2(...).toPromise().then(...).catch(...).finally is not a function

My code:

lineMap(criteria: ReportCriterionModel){

        this.service
            .getPastData2(
                criteria.deviceIds[0].toString(),
                criteria.vehiclePlates[0].toString(),
                criteria.startDate,
                criteria.finishDate)      
            .toPromise()
            .then(
                (data) => {   
                    this.loadDataToMap(data);  
                    this.filterData = criteria;      
                },
                (err) => {
                    if (err.status == 400) {                    
                        this.isLoadingFms.next(false);
                    }                    
                }
            )
            .catch(
                (err) => {
                    console.log(err);
                }
            )
            .finally(
                () => {                                              
                    this.isLoadingFms.next(false);
                    
                }
            )

    }

rxjs

rxjs6

rxjs-observables

0 Answers

Your Answer

Accepted video resources