It's now time to talk to the server! There is no fun in creating a workout, adding exercises, and saving it to later realize that all our efforts are lost because the data did not persist anywhere. We need to fix this.
Seldom are applications self-contained. Any consumer app, irrespective of its size, has parts that interact with elements outside its boundary. With web-based applications, the interaction is mostly with a server. Apps interact with the server to authenticate, authorize, store/retrieve data, validate data, and perform other such operations.
This chapter explores the constructs that Angular provides for client-server interaction. In the process, we add a persistence layer to Personal Trainer that loads and saves data to a backend server.
The topics we cover in this chapter include the following:
- Provisioning a backend to persist workout data: We set up a MongoLab account and use its Data API to access and store workout data.
- Understanding...