-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Event emitter for reset on forms #10999
Comments
How do you reset a form. If you reset the form imperatively you can notify yourself. If you use a reset button, this also emits an event. |
My specific use case is a directive which displays error for controls under configurable conditions (i.e. control has focus, control touched, form touched, form submitted, etc). When the form is reset I would like these directives to act accordingly (for example to not display certain errors). |
+1 for such feature. |
Given that you can already listen to the reset event or notify yourself, I'm inclined to think this isn't necessary. ngSubmit has extra value in that it allows the form directive's "submitted" state to be updated, but reset has no parallel state to set. I'd prefer not to add to the API surface unless it's really necessary. If more use cases come up for this in the future, we may reconsider, but closing for now. |
@kara could you give a quick example on how to catch form event (e.g., reset) myself? |
@mvar GitHub issues are for bug reports and feature requests. |
There are quite a lot of people nice enough to provide support - on the appropriate channels. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
With forms, one can subscribe to ngSubmit and be able to perform actions as a result of that.
There is no equivalent when resetting a form.
Expected/desired behavior
It would be very handy to have an ngReset EventEmitter which could notify subscribers of the act of resetting a form.
Reproduction of the problem
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: