DEV Community

Discussion on: Array.map() + async/await

Collapse
 
nyagarcia profile image
Nya

The Angular HttpClient is designed to work with Observables (data streams), and this approach is Promise-based. You have two options:

  1. Work with Observables, where you have to subscribe to the Observable object in order to access its data. You can find more information here

  2. You can you use the toPromise() utility, which will transform the Observable you are receiving to a Promise, which you can then handle in the traditional way. More info about toPromise here

I hope this helps you out. Let me know :)