O'Reilly logo

AngularJS by Example by Chandermani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Personal Trainer and server integration

As described in the previous section, client-server interaction is all about asynchronicity. As we alter our Personal Trainer app to load data from the server, this pattern becomes self-evident.

In the preceding chapter, the initial set of workouts and exercises was hardcoded in the WorkoutService implementation itself. Let's see how to load this data from the server first.

Loading exercise and workout data

Earlier in this chapter, we seeded our database with a data form, the seed.js file. We now need to render this data in our views. The MongoLab REST API is going to help us here.

Tip

The MongoLab REST API uses an API key to authenticate access request. Every request made to the MongoLab endpoints needs to have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required