Bhrungarajni
Bhrungarajni

Reputation: 2535

How to fetch the static data to the form using reactive forms

I have a reactive form, on click of new button, i am able to get the same section again. But here the options in the select field doesnt show up and also, i get an error as soon as page loads.

ERROR Error: Cannot find control with path: 'itemRows -> ContactName'

ERROR Error: Cannot find control with path: 'itemRows -> Phone'

ERROR Error: Cannot find control with path: 'itemRows -> Relationship'

Can anyone help me to solve this issue and help me to get dropdown list in Relationship.

On everytime page load i get that error and also data inside drop down also not visible. Please help

Upvotes: 0

Views: 350

Answers (1)

David Walschots
David Walschots

Reputation: 12660

It's not a good idea to put both formArrayName and formControlName on the same HTML node. Try to follow the pattern as described in the FormArrayName documentation. In your case, I'd start by putting formArrayName="itemRows" on a new div that is one level higher.

Upvotes: 1

Related Questions