Search code examples
angularnestedngfor

Angular ngFor in ngFor formControlName : Cannot find control with path


Starting out with Angular and trying to iterate over an array of objects that contain a nested array of objects. StackBlitz link below has all the code and text.

For app.component.html line 6-8 accessing the on line 17 fails.

Error:

Cannot find control with path: 'array -> 0 -> notePartials -> 0'
Cannot find control with path: 'array -> 0 -> notePartials -> 0 -> id'

If you expand the FormGroup printed in the console the data is at value -> array -> 0 -> notePartials -> 0

At a loss for what may be the issue... Displays without issue in a , but when trying to access from an input it fails.

StackBlitz


Solution

  • here is the link for possible solution. I have added all the formcontrols for notePartials object in the form so that you can access them in the html.