【发布时间】:2018-03-20 09:29:24
【问题描述】:
我正在使用 AWS API Gateway 为 Angular 4 中的项目生成 js SDK,我正在使用 sdk 调用端点并成功获取数据。在浏览器的网络选项卡中,显示的数据是正确的,当我使用 promise 使用相同的数据时
.then( response => { console.log(response); }
在控制台打印的数据和网络选项卡中的数据是不同的——甚至在我将它用于我的项目之前。
AWS API Gateway js SDK 代码:
getFundAdvisesList(fund: string) {
return this.credentialService.getAwsSDK().adviserFundAdviseGet({
'adviser': this.credentialService.$id,
'fund': fund
}, {}, {});
}
这是我用来调用上述 SDK 函数并在控制台上打印的代码
this.http.getFundAdvisesList(fund.fundName)
.then(response => {
console.log(response); // change in numbers seen in console
这里有几张图片显示了从网络标签到浏览器控制台的数据差异
https://drive.google.com/file/d/0B7HCwcSUzwkGWVRKbmo4cW9BSFk/view?usp=sharing https://drive.google.com/file/d/0B7HCwcSUzwkGRlhVNG1XMXJvQlU/view?usp=sharing
【问题讨论】:
标签: angular amazon-web-services