Ember.js 检查商店中是否存在给定id的记录?
在Ember.js 检查商店中是否存在给定id的记录?,ember.js,Ember.js,在TodoController的属性中,如何检查存储中是否存在类型为todo且具有给定id的记录 我使用本地存储适配器 fiddle(setter模式下的parentId属性应执行所述检查):通常,在找不到记录时使用404响应。在这个特定的实例中,您使用的是非常旧版本的余烬和余烬数据。因此,在一般用例中,您可以这样做: this.store.find('color', 1).then(function(record){ console.log('record', record); }, fu
TodoController
的属性中,如何检查存储中是否存在类型为todo
且具有给定id的记录
我使用本地存储适配器
fiddle(setter模式下的
parentId
属性应执行所述检查):通常,在找不到记录时使用404响应。在这个特定的实例中,您使用的是非常旧版本的余烬和余烬数据。因此,在一般用例中,您可以这样做:
this.store.find('color', 1).then(function(record){
console.log('record', record);
}, function(error){
console.log('error', error);
});