当我从数据库中删除某个项目时,出现以下错误
Attempted to handle event `pushedData` on <app@model:mymodel::ember851:myid> while in state root.deleted.inFlight.
但有时错误会改为:
Error: Attempted to handle event `notFound` on <app@model:mymodel::ember851:myid> while in state root.deleted.saved.
我的模特是:
export default Model.extend({
position: attr('number'),
name: attr('string'),
shared: attr('boolean', { defaultValue: false }),
color: attr(),
textColor: attr(),
permissions: attr(),
calendarstack: belongsTo('calendarstack'),
event: hasMany('event'),
isActive: attr()
});
我删除记录的代码:
delete: function(type, id){
var that = this;
this.store.findRecord(type, id).then(function(data) {
data.deleteRecord();
data.save();
});
}