this.usersSession = [{ "exercise": "chest press", sets: [12, 45, 32, 14] },
{ "exercise": "cable crossover", sets: [12, 5, 6, 31, 1] },
{ "exercise": "incline chest press", sets: [12, 45, 32, 14] },
{ "exercise": "decline chest press", sets: [12, 88, 2, 1] },
{ "exercise": "push up ", sets: [12, 45, 32, 14] }
]
this.exercise = this.usersSession.map(function (exercise_names) {
return exercise_names.exercise
});
console.log(this.exercise)
this.set = this.usersSession.map(function (sets_reps) {
return sets_reps.sets
});
=================================================================================================================================================================
HTML BELOW
<mat-accordion>
<mat-expansion-panel *ngFor="let panel of usersSession">
<mat-expansion-panel-header>
{{panel.exercise}}
</mat-expansion-panel-header>
<ul>
<li *ngFor="let repsCount of set">{{set}}</li>
</ul>
</mat-expansion-panel>
</mat-accordion>
<li *ngFor="let repsCount of panel.sets">{{repsCount}}</li>