Trying to add fields dynamically, but I keep getting this error. Can someone please point to me what is causing this. Link to stackblitz below.
Click Search ABC and the searched item gets added to the form below. This searched item ABC should be shown in the field.
ERROR Error: Cannot find control with path: 'items -> field2'
at _throwError (shared.ts:140)
at setUpControl (shared.ts:36)
at FormGroupDirective.addControl (form_group_directive.ts:132)
at FormControlName._setUpControl (form_control_name.ts:285)
at FormControlName.ngOnChanges (form_control_name.ts:212)
at checkAndUpdateDirectiveInline (provider.ts:207)
at checkAndUpdateNodeInline (view.ts:429)
at checkAndUpdateNode (view.ts:389)
at debugCheckAndUpdateNode (services.ts:430)
at debugCheckDirectivesFn (services.ts:391)
https://stackblitz.com/edit/angular-t36ees?file=src%2Fapp%2Fhello.component.ts