📜  在 Angular 8 中等待 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:53.748000             🧑  作者: Mango

代码示例1
private async fetchData(){
    const data = await this.httpClient.get(this.apiUrl).toPromise();
    console.log("Data: " + JSON.stringify(data)); 
  }