Form array of form group , get changes for exact specific control - angular


I have my form structure as below …

this.myForm ={
 control1: this.formBuilder.control({value: ''}),
 groupcontrol1: this.formBuilder.array({ this.addGroupControl() });

addGroupControl(): FormGroup {
     recurringControl1: this.formBuilder.control({value: ''}),
     recurringControl2: this.formBuilder.control({value: ''}),
     recurringControl3: this.formBuilder.control({value: ''}),

now for each of the recurring control I need to get notified for exact which recurring control value got changed and the index of that form group , for this I am using below code – this code is for

        .get('groupcontrol1'), index: number) =>
           .pipe(map((value) => ({ rowIndex: index, control: eachGroup, data: value })))
    ).subscribe((changes) => {

using above code , I am getting recurringControl1 value only from 1st form group , not other form groups . basically only when row index is 0 , only getting that value

any modification or suggestion on above code to get exactly which control out of the 3 recurring controls value changed

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.