1
當我拒絕解決承諾時,此錯誤將顯示在控制檯上。 控制檯: 例外:未捕獲的(在承諾):空error_handler.js:56 ORIGINAL堆棧跟蹤: 錯誤:未捕獲的(在承諾):空拒絕承諾作爲服務解決
@Injectable()
export class PaymentScheduleResolve implements Resolve<any> {
constructor(private rtoService: RtoService,
private rtoActivationService: RtoActivationService,
private router:Router,
private toastr: Toastr) {
}
resolve() {
var self = this;
return new Promise((resolve, reject) => {
let rtoInfo = self.rtoActivationService.getRtoInfo();
if (!rtoInfo) {
reject("null");// This will produce error on console
}
else{
self.rtoActivationService.getPaymentSchedules(rtoInfo.Id, rtoInfo.Data.RtoRentLength)
.then((res: any) => {
if (res.Response && res.Response.Code === 200) {
resolve(res.Response.Data);
}
else {
reject(null);// This will produce error on console
}
})
.catch((err: any) => {
console.log(err);
reject(null);// This will produce error on console
})
}
});
}
角2.4.1和3.4.1路由器版本 – Faris
你有什麼期望? –