Angular json在通过promise(aws api gatway SDK)使用时发生了更改

Angular json在通过promise(aws api gatway SDK)使用时发生了更改,angular,amazon-web-services,Angular,Amazon Web Services,我正在为angular 4中的一个项目使用AWS API Gateway生成的js SDK,我正在使用SDK调用端点并成功获取数据。在浏览器的“网络”选项卡中,显示的数据是正确的,当我使用promise使用相同的数据时 .then( response => { console.log(response); } 控制台中打印的数据和网络选项卡中的数据是不同的——甚至在我将其用于我的项目之前 AWS API网关js SDK代码: getFundAdvisesList(fund: string

我正在为angular 4中的一个项目使用AWS API Gateway生成的js SDK,我正在使用SDK调用端点并成功获取数据。在浏览器的“网络”选项卡中,显示的数据是正确的,当我使用promise使用相同的数据时

.then( response => { console.log(response); }
控制台中打印的数据和网络选项卡中的数据是不同的——甚至在我将其用于我的项目之前

AWS API网关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
以下几张图片显示了从网络选项卡到浏览器控制台的数据差异


确切的原因不是没有,而是由于在console.log行之后编写的代码

由于java脚本在默认情况下是异步的,所以打印的数据由代码的另一部分更改。它主要发生在我将接收到的数据数组转换成特定对象(typescript模型)的地方