This confuses all new Angular Developers.
Using the built-in Angular HTTP client doesn't work the way you might expect.
Most libraries that make network requests will return Promises when fetching data because it's an asynchronous action right? Angular likes to be different and each of the methods on the Angular HTTP service don't return Promises.
They return RxJS Observables instead.
This means you can't use the shorthand `async/await` keywords or access a `.then` property (if you're not into the whole brevity thing) on the returned object, you need to `subscribe` to the Observable returned instead.
Inside the subscription you can get the results from the network call from the `next` property and `error` will give you any errors thrown when making the call.
Смотрите видео How to make an Angular HTTP GET Request онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code With Bubb 20 Февраль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,692 раз и оно понравилось 47 людям.