simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

[ng-core] Feature request: Sync validation errors, touched, and dirty status #41

Open ersimont opened 3 years ago

ersimont commented 3 years ago

It is possible to sync these things 2-ways between the outer and inner form controls. See the example from @DmitryEfimenko at https://github.com/DmitryEfimenko/s-libs-superclass

ersimont commented 3 years ago

Update, after much debate, I will put this on hold until after angular 12 is out. Because I don't think I would get the full functionality implemented in time, and there are some quicker wins I could get out the door sooner.

The full list of features that should go together (in draft form, after some brainstorming):

The general idea is to fully synchronize the outer NgControl with the inner one, IF that outer control exists. (If it does not exist, no problem, just keep today's behavior without these extra features.)

ersimont commented 2 years ago

It looks like support is missing for InjectFlags.Optional, as used at https://github.com/DmitryEfimenko/s-libs-superclass/blob/main/src/app/simple-autocomplete/wrapped-form-control-superclass.ts#L186.

It looks like support may still land in v13? https://github.com/angular/angular/pull/41592 Though it seems like 13 should be fairly locked by now ...

DmitryEfimenko commented 2 years ago

Yeah, this was a while ago. I almost don't remember what was the culprit. Hopefully Angular team can get this PR in for the v13.