采取以下措施:
FooController = Ember.ObjectController.extend
# Model is set, view is rendered, button is clicked
someDeleteAction: ->
# Object is destroyed & removed from view
@get('content').deleteRecord();
# Uh-oh... error happens here, but object
# remains 'deleted' according to ember
@get('content.transaction').commit();
有没有办法防止对象被破坏并从视图中删除?
奖励积分:中国水刑的1级...... ember-data
多少有趣?
答案 0 :(得分:0)
我的解决方案:
覆盖DS.Model.deleteRecord
,使其先与服务器联系,然后commit
进行交易。