I have an Array named 'habits' that looks like this: https://i.sstatic.net/x3aYz.png
I am displaying it in a table with radio buttons for yes and no options.
https://i.sstatic.net/iAsqO.png
<tr *ngFor="let habits of masterDate.data.habits; index as x">
<th class="tbl-border-right-bottom text-wrap" style="width: 50%">
{{ habits.name }}
<div hidden="true">
<input type="text" formControlName="habitsSufferedMainId{{ x }}" />
</div>
</th>
<td class="tbl-border-right-bottom">
<div class="col-md-6">
<div class="form-group d-flex justify-content-around pr-2">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="habitsSufferedMain{{ x }}" value="1" name="habitsSufferedMain{{ x }}" formControlName="habitsSufferedMain{{ x }}" />
<label class="custom-control-label" for="habitsSufferedMain{{ x }}">Yes</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="isMainHabitNo{{ x }}" value="0" name="habitsSufferedMain{{ x }}" formControlName="habitsSufferedMain{{ x }}" [checked]="true" />
<label class="custom-control-label" for="isMainHabitNo{{ x }}">No</label>
</div>
</div>
</div>
<div class="form-group">
<textarea placeholder="If 'Yes', please provide details" class="form-control form-control-sm" rows="2" formControlName="habitsSufferedMainReason{{ x }}"></textarea>
</div>
</td>
</tr>
- Does anyone know how to set the default value to "No"?