- I'm using angular form Control.
- I have set of values to display in a form,few are static and few are dynamic.
- I'm displaying static values with formControlName and and ts file I'm receiving in fb group as below.
For Known values I doing as below.
Html File
<input type = "text" formControlName="catalogItemId">
Ts File
this.catalog Form = this.fb.group({
catalogItemId:fb.control('').
.
.
so on
})
For Dynamic values(Unknown values),I'm looping then as below(since I don't know what are fields going come here).
<mat-list-item *ngFor="let data of attributeMap | keyvalue">
<mat-form-field>
<mat-label>{{data.key}}</mat-label>
<input matInput type="text" value = {{data.value}}
</mat-form-field>
</mat-list-item>
Now the Question is How can I get these dynamic values in my form group(i.e this.catalog Form )
I haven't used the form builders before and I'm looking through many articles to get this doubt cleared. Hoping a solution.Thanks in Advance.