From the course: Ionic 4.0 Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Consuming REST APIs

Consuming REST APIs - Ionic Tutorial

From the course: Ionic 4.0 Essential Training

Start my 1-month free trial

Consuming REST APIs

- [Instructor] In this video, HTTP code to retrieve data from an API for our application. For the sake of this application, we have a live API that we have created that is working. Now, before we start working with this API, the first thing we want to do is to setup HttpClient in our Angular application. HttpClient is a feature from Angular that allows you to interact or rest APIs and retrieve data. In order to work with HttpClient, the first thing you want to do is go into our app model the .ts file, and then we want to input the HttpClientModule, so just after line three I would write import from the @angular/common/http and inside there, I would call the HttpClientModule. After we have done this as I have done on line four, we still need to tell Angular that we want to use the HttpClientModule inside our application. and we can do a little bit of housekeeping here just to make sure everything is very readable, and then we will add the HttpClientModule. Now what we have done on line…

Contents