From the course: Ionic 4.0 Essential Training

Unlock the full course today

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

Consuming REST APIs: Implementing methods

Consuming REST APIs: Implementing methods - Ionic Tutorial

From the course: Ionic 4.0 Essential Training

Start my 1-month free trial

Consuming REST APIs: Implementing methods

- [Instructor] The next thing we're going to go ahead and do is implement our methods. The first method we will implement is the get all activities. To implement this we'll start by saying return, this.httpclient.get and as a parameter we would would pass in our API here. Now let's explain what we've just done here from line 15 to line 17. We already had a method called get all activities from our previous videos. And what we have done is we have used the angular http client, which in turn has a get method, that allows us to make get http requests. The mandatory parameter that a get method requires is the URL for our API. We can also parse other methods, but for the sake of this course, we're not going to build beyond this scope. The get method of the angular http client, returns what we call an observable and this is something we'll talk about a little bit more in future videos. All you need to know for now, is that the get all activities method, returns an observable with some data…

Contents