Fetching data
As we already know from Chapter 2, Getting Ready, reading data from the database is mostly a matter of having the Angular app (the front-end) send HTTP requests to the ASP.NET app (the back-end) and fetching the corresponding HTTP responses accordingly; these data transfers will be mostly implemented using JavaScript Object Notation (JSON), a lightweight data-interchange format that is natively supported by both frameworks.
In this section, we’ll mostly talk about HTTP requests and responses, see how we can fetch data from the ASP.NET app, and lay out some raw UI examples using Angular components that will be further refined throughout the next sections.
Are we ready? Let’s start!
Requests and responses
Let’s start by taking a look at those HTTP requests and responses we’ll be dealing with: hit F5 to launch both WorldCities
and WorldCitiesAPI
projects in debug mode – or right-click the WorldCitiesAPI
project and select...