My radio button list displays the days of the week, with their corresponding values as weekday IDs in Number format. However, when I use Angular to bind these values in my form group, they are transformed into strings.
const currentHour = moment('08:00', 'hh:mm');
new Array(7).fill(null).forEach((acc, index) => {
this.weekdays.push({
day: Number(currentHour.weekday(index).format('d')),
short: currentHour.weekday(index).format('dd'),
long: currentHour.weekday(index).format('dddd')});
});
<div class="col weekdays" *ngFor="let weekday of weekdays">
<input
formControlName="repeatEveryDay"
name="repeatEveryDay"
type="radio"
id="weekday-{{weekday.long | lowercase}}"
[value]="weekday.day"
[checked]="weekday.day == repeatEveryDay"
>
<label for="weekday-{{weekday.long | lowercase}}">{{weekday.short | uppercase}}</label>
</div>
Is there a way to retrieve the Number value, or is this just how Angular functions?