docs(forms): use a number as input value for formControlName (#30606)
PR #29473 changed the docs to use a string as the input value of `formControlName`, as it used to only accept a string. This has been changed, and `formControlName` now accepts a string or a number, so the example in the docs can use a binding as they used to. PR Close #30606
This commit is contained in:
parent
a647298412
commit
bed680cff8
|
@ -17,7 +17,7 @@ import {FormArray, FormControl, FormGroup} from '@angular/forms';
|
|||
<form [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||
<div formArrayName="cities">
|
||||
<div *ngFor="let city of cities.controls; index as i">
|
||||
<input formControlName="{{i}}" placeholder="City">
|
||||
<input [formControlName]="i" placeholder="City">
|
||||
</div>
|
||||
</div>
|
||||
<button>Submit</button>
|
||||
|
|
Loading…
Reference in New Issue