1
私は解決の約束を拒否すると、コンソールにこのエラーが表示されます。コンソールで : 例外:(約束で)キャッチされない:ヌルerror_handler.js:56 ORIGINAL STACKTRACE: エラー:(約束で)キャッチされない:ヌル誓約を拒否してサービスとして解決する
@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
エラーページにリダイレクトすることができますか? –