Duration: 17:19 min
Summary: In this lesson, we will see how to call a service and read JSON data. Since this is an angular course, we will not spend the time in creating the web service. We will use a publicly available URL that returns JSON data. We will then use the $http service to get the data and display it in a table. As you will see, HTTP calls are async, which means that we cannot store the result of the call directly in a variable and expect the result to be there. We will use a callback function that provides the data to us once the response is available. We will also add a call to another function that handles errors (in case the call to the service returned a 404…).