
Using the Personal Trainer model in Workout Builder services
Services are useful for sharing data across controllers and other Angular constructs. Open the model.ts file present in the core folder under app. In this class, we essentially do not have any data, but a blueprint that describes the shape of the data. The plan is to use services to expose this model structure. We have already done that in Workout Runner. Now, we will do the same in Workout Builder.
The model.ts file has been moved into the core folder as it is shared across the Workout Builder and Workout Runner apps. Note: in checkpoint4.1 we have updated the import statements in workout-runner.component.ts , workout-audio.component.ts, and workout-history-tracker-service.ts to reflect this change.
In Chapter 1, Building Our First App - 7 Minute Workout, we reviewed the class definitions in the model file: Exercise, ExercisePlan, and WorkoutPlan. As we then mentioned, these three classes constitute our base model. We will now start using this base model in our new app.
That's all on the model design front. The next thing we are going to do is define the structure for the new app.