feature: support form errors (see issue #15) #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you adding/fixing?
I love the syntax of ngxErrors so much, that I wanted to use it not just for form control errors, but for form errors itself. See issue #15
Have you added tests for your changes?
I'm sorry, I did not. But the existing tests still passed.
Will this need documentation changes?
Yes, I imagine this feature is something ppl would want to know about.
Does this introduce a breaking change?
I don't think so. As far as I can tell, all existing functionality still remains.
Other information
This code is a bit ugly, not super DRY. I sort of intended it as a proof of concept. It could be cleaned up and refactored, maybe we need a concept of a single object that can be either a form control or a form group. I'm especially displeased with having to call
detectChanges()
but I haven't found a way around it for OnPush change detection strategy. If anybody knows how to avoid it, pls let me know, I want to learn.Thanks @toddmotto for a great project!