vendredi 12 octobre 2018

Ember Model - Manually resetting changes does not always reset hasDirtyAttributes

I have an ember model called client. It has attributes name, auditRate, and toDelete which defaults to false (I cannot post the actual code because this is a company-internal project). The toDelete attribute is meant to be toggle-able via a checkbox. Naturally, when the box is checked and toDelete is marked as true, the client's hasDirtyAttributes flag is also set to true. And also naturally (I would think), when the box is subsequently unchecked and toDelete is marked as false – assuming no other changes have been made – the client's hasDirtyAttributes flag is also set to false. This is how it generally works.

However, occasionally, when the box is unchecked, hasDirtyAttributes remains set to true, even though no other changes have been made to the model (at least not manually or purposefully).

Without being able to inspect my code, would anybody be able to tell why that might be happening sometimes but not others?




Aucun commentaire:

Enregistrer un commentaire