The Angular HttpClient is designed to work with Observables (data streams), and this approach is Promise-based. You have two options:
Work with Observables, where you have to subscribe to the Observable object in order to access its data. You can find more information here
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 :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The Angular HttpClient is designed to work with Observables (data streams), and this approach is Promise-based. You have two options:
Work with Observables, where you have to subscribe to the Observable object in order to access its data. You can find more information here
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 :)