fix(form): make ngForm $pristine after nested control.$setPristine() (counter version)
When calling $setPristine on the nested form or control, form becomes $pristine of all the nested controls are pristine
Closes #13715
It generally LGTM (with a couple of nitpicks), BUT:
We need to properly handle added/removed controls.
Now it uses internal counter. It's a bit complicated, because we have to divide $setPristine propagtion into capturing and bubbling.
Also I'm not 100% sure that idempotence test cases are sufficient (I think this is crucial).
I think it's best to have the two alternative approaches as two independent PRs (so we can review/update/decide upon separately). Could you split revert the second commit and put it into a separate PR ?
Thx @linoleum-js for working on this, btw :+1:
Has this been split?