大家好,发生错误时我有问题,我看不到响应的内容。调试时,我注意到该错误看起来像img中所示,我该如何处理呢?任何提示或建议都欢迎,谢谢。
这是我的ajax代码。
SelectItemsFromInbox(selectedItems: InboxItem[], initialDate: Date, finalDate: Date, travelState: string)
{
let reqOptions: {} = this.requestUtils.createHeaders();
return this.http.post('InboxApi/SelectItemsFromInbox', {
selectedItems: selectedItems,
initialDate: initialDate.toISOString(),
finalDate: finalDate.toISOString(),
travelState: travelState
}, reqOptions)
.toPromise()
.then(res => <InboxItem[]>res.json())
.then(data => { return data; })
.catch(data => {
console.log(data);
debugger;
this.messageService.add ({ severity: 'error', summary: 'Error!', detail: 'Algo salio mal contacte al administrador' });
return null;
});
}