JSON.stringify(this.workout)
is not properly stringifying the entire object. The workout
variable is an instance of the Workout
class, defined as follows:
export class Workout {
id: string;
name: string;
exercises: Exercise[];
routine: Routine;
}
The Exercise and Routine classes also contain nested arrays.
The issue lies in the fact that JSON.stringify(this.workout)
only returns {"name":"Day 1"}
. Can anyone suggest where the problem might be?