I want to increase the map by 5 with each iteration.
var newSet = new Set();
newSet.value = trainingExercise.sets.length
? Math.max(...trainingExercise.sets.map((s) => s.value))
: 0;
trainingExercise is variable like
{
exerciseId: 108
exerciseName: "Name",
isTest: true,
isTimed: false,
sets: [
{
completed: false,
isWarmup: false,
note: "",
pause: 0,
reps: 0,
value: 0
}
]
}
So I want to set the values ??to start at 5 and increase with each iteration by for example 5
First iteration 5 second 10 , third 15......
Don't be confused trainingTemplateExercises is same values as trainingExercise...
<tr *ngFor="let set of trainingTemplateExercises.data.sets; index as i" [@enterAnimation]>
<td style="width: 10%;">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="{{ 'warmUp' + trainingTemplateExercises.data.id + i }}" [(ngModel)]="set.isWarmup" />
<label class="custom-control-label" for="{{ 'warmUp' + trainingTemplateExercises.data.id + i }}">{{ set.isWarmup ? "Da" : "Ne" }}</label>
</div>
</td>
<td style="width: 18%;">
<input type="number" [(ngModel)]="set.reps" name="reps" class="form-control radius" />
</td>
<td style="width: 18%;">
<input type="number" [(ngModel)]="set.value" name="value" class="form-control radius" />
</td>
<td style="width: 18%;">
<input type="number" [(ngModel)]="set.pause" name="pause" class="form-control radius" />
</td>
<td style="width: 31%;">
<input type="text" [(ngModel)]="set.note" name="value" class="form-control radius" />
</td>
<td style="width: 5%;">
<button type="button" class="btn btn-link text-danger px-0" (click)="removeSet(trainingTemplateExercises.data, i)">
<img class="trash-icon" src="../../../assets/aplikacija/trash.png" width="30" height="30" alt="trash">
</button>
</td>
</tr>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…