This is a question to gain a deeper understanding of Angular Reactive Forms.
We're about to create a lot complex components with lots of FormControl objects in each dialog. Therfor many things are set dynamically at runtime for those FormControl objects:
- data from model (obvious)
- validation rules (via
control.setValidators(valArray)
) - enablement/diablement (e.g. via
control.disable()
)
Code examples are to large to show here.
The problem is: after setting all components to new values, validations and enablement and a final this.formGoup.marktAsPristine()
some fields are still or again dirty
One thing is, that we still have some Angular typical concurrency topics to solve. So it's - in the moment - more than likely that after that this.formGoup.marktAsPristine()
some concurrent activities are still running. But for my understanding of Angular:
What actions can set a FormControl again to dirty, if no user interaction took place so far?
Documentation and my quite fat Angular book could not explain it to me.