fix(form): make ngForm $pristine after nested control.$setPristine() (counter version)#13773
fix(form): make ngForm $pristine after nested control.$setPristine() (counter version)#13773martinschulzofficial wants to merge 2 commits intoangular:masterfrom
Conversation
When calling $setPristine on the nested form or control, form becomes $pristine of all the nested controls are pristine Closes angular#13715
There was a problem hiding this comment.
You should change this to expect(form.$dirty).toBe(false); and remove the subsequent call to form.$setPristine().
|
It generally LGTM (with a couple of nitpicks), BUT: We need to properly handle added/removed controls. |
70049ae to
b77e14b
Compare
|
Now it uses internal counter. It's a bit complicated, because we have to divide |
|
I think it's best to have the two alternative approaches as two independent PRs (so we can review/update/decide upon separately). Thx @linoleum-js for working on this, btw 👍 |

When calling $setPristine on the nested form or control,
form becomes $pristine of all the nested controls are pristine
Closes #13715