ember.js - Ember Data Model rollback not working on custom attribute of model -
i have js bin. know reason why, when modify user model , click button rollback, why firstname property beingness rolled not array custom attribute? thanks.
http://emberjs.jsbin.com/nunihuco/1/edit?html,js,console,output
ember info watches property itself. property isn't changing, info within is. you'd need alter property able rollback.
this.set('model.listofstuff', ['hello','world']); http://emberjs.jsbin.com/nunihuco/2/edit
if wanted, clone , modify. works on primitive types though, if have objects, you'd run same thing.
var orig = this.get('listofstuff'), newarr = orig.slice(); this.set('listofstuff', newarr); newarr[0] = 'asdf'; http://emberjs.jsbin.com/nunihuco/3/edit
ember.js ember-data
No comments:
Post a Comment