EP 11.2 - Angular / HTTP / Core HTTP API Setup & Usage

Publicado el: 26 diciembre 2018
en el canal de: jawache
16,691
46

📚 Read the book 👉 https://go.asim.dev/angular-book
🔥 Level up your JavaScript 👉 https://go.asim.dev/advjs
🌿 If you find my videos useful please consider planting a tree for me 👉 https://go.asim.dev/trees
🎥 Watch the full playlist 👉 https://go.asim.dev/angular-playlist

The best place to view the code associated with this course is in the online book (https://go.asim.dev/angular-book) via the book if a lecture has code associated with it, it then also has a link to a stackblitz instance so you can run and edit the code sample online.


We inject the Http client library into our classes, it’s a dependency that needs to be configured in Angulars DI framework.

Rather than separately setting up each provider for all the different parts of the Http client library, we can instead import the HttpModule and add to our NgModule imports list. This sets up the injector on our NgModule with all the necessary providers.

We make requests for all the HTTP verbs by calling matching functions on our Http client library.

By default these requests return observables which we can subscribe to, we can also convert these observables into promises and handle the asynchronous responses that way.

We handle errors using the typical observable or promise error handlers.

We send custom headers alongside our requests by passing in an appropriately configured RequestOptions object to our HTTP functions.

This lecture covered the basics of using the HTTP client library, in the next lecture we’ll go through a specific example using promises.


En esta página del sitio puede ver el video en línea EP 11.2 - Angular / HTTP / Core HTTP API Setup & Usage de Duración hora minuto segunda en buena calidad , que subió el usuario jawache 26 diciembre 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 16,691 veces y le gustó 46 a los espectadores. Disfruta viendo!