Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(form): add $dirtyAfter state to form controls - #5888

Closed
troch wants to merge 1 commit into
angular:masterfrom
troch:form-controls-dirtyAfter
Closed

troch wants to merge 1 commit into
angular:masterfrom
troch:form-controls-dirtyAfter

Conversation

@troch

@troch troch commented Jan 19, 2014

Copy link
Copy Markdown

This is my attempt to add features to client side validation and inline form validation.

The aim of having a $dirtyAfter state per control is to track user's progress through the form and not display validation messages prematurely.

add $dirtyAfter state to form controls to help with inline form validation

contribute to issue angular#583
@troch

troch commented Mar 3, 2014

Copy link
Copy Markdown
Author

Any feedback on this?

@Narretz

Narretz commented Jul 21, 2014

Copy link
Copy Markdown
Contributor

@troch It looks like the new $touched / $untouched props solve a similar problem: adcc5a0
Do you agree, or did you try to achieve something else with dirtyAfter? The only real difference I see is that $touched / $untouched is not reset when calling $setPristine, and that it uses real events rather than reacting to $setViewValue

@Narretz Narretz added this to the Ice Box milestone Jul 21, 2014
@troch

troch commented Jul 22, 2014

Copy link
Copy Markdown
Author

It is slightly different: the idea of $dirtyAfter is not to give status information about the current form element, but to check if any form element after the current one is dirty.

In practice, this could be used to show inline validation messages on a form element which has been skipped by a user.

@Narretz

Narretz commented Feb 11, 2016

Copy link
Copy Markdown
Contributor

I've decided that this will not be implemented. It adds a layer of complexity to the ngModel / form API that not many poeple will benefit from. I also doubt that showing messages for skipped form fields is a common enough use case. Either your form fields need to be filled out in a specific order - then you have to implement the restriction anyway - or they don't have to be,

@Narretz Narretz closed this Feb 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants