Ember.js 回滚()后仍存在未提交的记录
我在ObjectController中具有以下内容,并已验证两个操作都被正确调用:Ember.js 回滚()后仍存在未提交的记录,ember.js,ember-data,Ember.js,Ember Data,我在ObjectController中具有以下内容,并已验证两个操作都被正确调用: setup: -> transaction = @get('store').transaction() post = transaction.createRecord(App.Post, {postedAt: new Date()}) @set('content', post) cancel: -> @get('content.transaction').rollback() 但是
setup: ->
transaction = @get('store').transaction()
post = transaction.createRecord(App.Post, {postedAt: new Date()})
@set('content', post)
cancel: ->
@get('content.transaction').rollback()
但是,尽管事务被回滚,但未提交的记录仍然存在于数据存储中
我是否应该在事务中以不同的方式处理创建的记录
编辑:在回滚事务后,我还看到类似这样的错误:
Error: Attempted to handle event `didSetProperty` on <App.Post:ember926:null> while in state rootState.deleted.saved. Called with {name: title}
错误:试图在状态为rootState.deleted.saved时处理事件'didSetProperty'。用{name:title}调用
我必须通过在列表视图中使用{{#除非isDeleted}}来解决这个问题。也许我做错了什么,但当我在JSFIDLE中做类似的事情时,似乎不需要解决方法。我也有这个问题,你能告诉我如何解决吗?有更新@KevinAnsfield吗?