Not able to pass string to formGroup

1.I want to loop through an array

*ngFor="let item of myformNameArray"

Think myformNameArray.length have 3 items
If I console item it will be like

myFormName1
myFormName2
myFormName3

I have already made these form group in my typescript component.

Example

<form [formGroup]="myFormName3">

It will work perfectly!!

But i want to loop :means

<div *ngFor="let item of  myformNameArray">
<form [formGroup]="{{item}}">
</form>
</div>

So when I do,

[formGroup]="{{item}}"

It throws me an error can’t assign to object or interpolation

Or

[formGroup]="see(item)"

Where ,

see(item) :string {
return String(item);
}

ERROR TypeError: can’t assign to property "validator" on "see(item)": not an object

46 thoughts on “Not able to pass string to formGroup”

  1. 688556 621063I will correct away grasp your rss as I can not in discovering your e-mail subscription hyperlink or e-newsletter service. Do youve any? Kindly permit me realize so that I could subscribe. Thanks. 590904

    Reply

Leave a Comment