'Angular pipe with reactive formControlName of angular form array
Here i am using custom pipe to format the rate field. Which is read only field. Issue is value attribute not formating the rate field on page load. Which is working for another fields
<div formArrayName="rateList" *ngFor="let product of formData.controls; let i=index;">
<div [formGroupName]="i">
<input formControlName="rate" readonly="readonly"
[value]="formData.controls[i].get('rate').value | udpCurrency : false : this.translate.currentLang" />
</div>
</div>
Solution 1:[1]
I don't know the exact answer for this, but as a workaround you can use setTimeout at the time you are setting the value to the form array.
setTimeout(()=> {
this.rateList.setValue(someRateArray)
} ,0)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shivansh Kumar |
