underlined texti used [attr.name] to add the name attribute:
<input class="form-check-input" type="radio" [(ngModel)]="model.questions[i].answer" name="model.questions[{{i}}].answer" [attr.name]="i" [value]="rv.id" />
html look like
<label> <input class="form-check-input ng-pristine ng-valid ng-touched" type="radio" ng-reflect-name="model.questions[4].answer" ng-reflect-value="12" value="12" name="4"> Very Easy </label> <label> <input class="form-check-input ng-pristine ng-valid ng-touched" type="radio" ng-reflect-name="model.questions[4].answer" ng-reflect-value="13" value="13" name="4"> Easy</label> <label> <input class="form-check-input ng-pristine ng-valid ng-touched" type="radio" ng-reflect-name="model.questions[8].answer" ng-reflect-value="16" value="16" name="8"> Very Satisfied </label> <label> <input class="form-check-input ng-pristine ng-valid ng-touched" type="radio" ng-reflect-name="model.questions[8].answer" ng-reflect-value="17" value="17" name="8"> Satisfied </label>
now you can see the name attribute, angular does not fill in the name attribute if you use {{}} in the name, and if you do not use {{}}, it will print the value as a string without evaluation. issue the html radio button tab index in the default function, because it is based on the name attribute.
source share