I am binding table using ngrx-forms formStateArray. I want to mark controls as dirty when the original value is not equal to user entered value. I tried with following
onNgrxFormsAction(MarkAsDirtyAction, (state, action) => {
let newFormArrayState = state.formState;
if (originalValue === newValue) {
const pristineAction = new MarkAsPristineAction(action.controlId);
newFormArrayState = formArrayReducer(state.formState, pristineAction);
}
return {
...state,
formState: newFormArrayState,
}
}),
The code above is updating the control as pristine. How to update parent form state based on all of its child?
Or is there any way to achieve this?