I am currently working on an ionic application (angular1) and I am working on a huge object.
The object will look like this:
userWorkouts: [
{
title: '3 Split',
id: 1,
workoutImg: '',
workoutSessions: {
1: {
workoutSessionName: 'Monday',
workoutExerciseList: {
1: {
exerciseName: "Pull Ups",
exerciseSets: {
1: 20,
2: 12,
3: 8
}
},
2: {
exerciseName: "Pull Ups",
exerciseSets: {
1: 20,
2: 12,
3: 8
}
}
}
}
}
},
{
title: 'Kraftausdauer Teil 1',
id: 2,
workoutImg: ''
},
{
title: 'Kraftausdauer Teil 2',
id: 3,
workoutImg: ''
},
{
title: '7 Minuten Training',
id: 4,
workoutImg: ''
},
{
title: 'Workout Zuhause',
id: 5,
workoutImg: ''
}
]
Example: a user has x workouts. Each workout has x sessions (Monday, Wednesday, Friday). The session also has x Exercises with x sets.
Problem: I want to modify this object, and I have a few problems:
Problem: I want to add sessions (Monday, Wednesday, Friday).
var session = {
workoutSessionName: sessionName
};
userWorkouts[1].push(session)
Does not work because its object. Is there any other way to "click" on an object?