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

ngForm stays $dirty after control.$setPristine() #13715

Description

@jar240

Hi there. Frustrating problem. in an ngForm, if in my controller I set one of the form's controls to $dirty (via control.$setDirty()), then in the controller set the same control to $pristine, the form remains $dirty.

  1. on state load, form is $pristine
  2. via another event, call controller function that does control.$setDirty() - form is now $dirty
  3. via another event, call controller function that does control.$setPristine() - form is still $dirty

I'm pretty sure this shouldn't happen, and is getting kludgy to fix. I'm using Angular 1.4.8.

Plunkr:
https://plnkr.co/edit/6noEtj6vbMkqxiKK6Yp7?p=preview

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions