Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ersimont opened this issue Apr 21, 2021 · 3 comments

Comments

@ersimont
Copy link
Member

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
Copy link
Member Author

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):

  • pending

  • validation errors

    • valid
      invalid
      hasError
      getError
  • touched & untouched

  • dirty & pristine

  • disabled & enabled

  • status

    • status changes
  • name

  • path?

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
Copy link
Member Author

ersimont commented Oct 6, 2021

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? angular/angular#41592 Though it seems like 13 should be fairly locked by now ...

@DmitryEfimenko
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants