Front-End and Back-End Interactions
Now that we have a minimalistic—yet fully working—Angular web app up, running, and connected with our ASP.NET Core API, we can start to build some stuff. In this chapter, we’re going to learn the basics of client-side and server-side interactions: in other words, how the front-end (Angular) can fetch some relevant data from the back-end (ASP.NET Core) and display it on screen, in a readable fashion.
As a matter of fact, we should’ve already got the gist of how it works in Chapter 3, Looking Around, when we worked with Angular’s FetchDataComponent
and ASP.NET Core’s WeatherForecastController.cs
classes and files. The Angular component (front-end) pulls data from the ASP.NET controller (back-end) and then puts it on the browser screen (UI) for display.
However, controllers aren’t the only way for our ASP.NET Core back-end to serve data to the front-end: we can also serve static files, or use...