how to await for a function angular 11 code example
Example: await in angular 8
private async fetchData(){
const data = await this.httpClient.get(this.apiUrl).toPromise();
console.log("Data: " + JSON.stringify(data));
}
private async fetchData(){
const data = await this.httpClient.get(this.apiUrl).toPromise();
console.log("Data: " + JSON.stringify(data));
}