ember.js - Reset isDirty-flag -


i have 2 models:

// subject export default ds.model.extend({     willbeactive: ds.attr('boolean') })  // studyplan export default ds.model.extend({     name: ds.attr('string'),     subjects: ds.hasmany('subjects'),     havachanges: function(){         var isdirty = this.get('isdirty'),           subjectsdirty = this.get('subjects').isany('isdirty', true);         return subjectsdirty || isdirty;     }.property('isdirty', 'subjects.@each.isdirty') }) 

i use embeddedrecordsmixin , activemodeladapter embed inside studyplan payload subjects have changed, when promise resolved isdirtyflag of each subject remains in true. can reset isdirty flag of each subject after saving studyplan?

you might interested in this package

it marks parent dirty when child record dirty , clears isdirty field on child records when parent saved.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -