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
improvement(api): explicit show/hide errors #21
improvement(api): explicit show/hide errors #21
Conversation
projects/ngneat/error-tailor/src/lib/control-error.directive.ts
Outdated
Show resolved
Hide resolved
@NetanelBasal I tried to add some tests to make sure that the new methods work as expected. Because I am not a standard user of the Spectator, I am not sure what would be the best way to check, that after invoking PS: A general question, how does the logic exactly work with the syntax I would certainly use a separate simple component, with only one <input> placed, to have a more simplified situation for selection, but I would prefer to have a bit more combined case. |
README.md
Outdated
@@ -197,6 +197,28 @@ One typical case when to use it is radio buttons in the same radio group where i | |||
<input [controlErrorsOnBlur]="false" formControlName="name" /> | |||
``` | |||
|
|||
## Methods | |||
|
|||
- `showError()` - Allows programmatic access to show a control error component, even when no other invoking event had been happened (like a blur or a submit). There should be a validation error on such an element, of course. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section is too long. Make it shorter, please.
@NetanelBasal I have an use case where I add error/validator manually and call Btw, here a demonstration: Stackblitz demo Another use case that I have is to show errors in a stepper once the user click to proceed without filling all fields correctly (as the "Proceed" button in each stepper is |
This PR isn't ready. |
Hmmm.. could I help somehow to speed this up or will @mlc-mlapis conclude this? I'm asking because without this is being really difficult to show errors for the cases abovementioned. |
Any news here? |
@NetanelBasal, I apologize for that delay. I should prioritize it and hope that I would be able to do the necessary during this week. |
…roying # Conflicts: # src/app/app.component.scss # src/app/app.component.ts
@NetanelBasal I have finalized the required tests and hope that it looks fine for you now. 😃 Also, I have reduced descriptions in |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
It's not possible to programmatically show/hide validation errors.
What is the new behavior?
New API added to programmatically show/hide validation errors.
Does this PR introduce a breaking change?