GithubHelp home page GithubHelp logo

Comments (4)

cstephe avatar cstephe commented on May 28, 2024

Can you post how you are loading data. Form dirty normally doesn't get set unless you are triggering user events.

from angular-unsavedchanges.

samlevin avatar samlevin commented on May 28, 2024

Basically making a call to an HTTP service, which returns an object (in a predetermined format), and then I bind that object to scope in a controller. The UI template uses this controller, and I'm using 'ng-model' (on the $scope object properties) to display the object properties in the UI

EDIT: After I load the controller/template with the form, the log states 'all forms are clean'. However, when I try to click another object (which loads a new form), I then get a log message stating 'a form is dirty', even after I've made 0 clicks on the UI (aside from opening up a new form).

from angular-unsavedchanges.

samlevin avatar samlevin commented on May 28, 2024

It seems like $pristine() is called after the directive loads, but before the HTTP call has finished.

from angular-unsavedchanges.

awerlang avatar awerlang commented on May 28, 2024

Make sure your form is in $pristine state while it is loading data. Perhaps a specific control your are using is setting your form as $dirty.

It may help to pinpoint the exact source of error if you put a breakpoint on $setDirty() to see who is calling that.

from angular-unsavedchanges.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.