Reputation: 23873
In a property of a TodoController
, how do i check whether a record of type todo
and given id exists in the store?
I use the LocalStorage adapter.
A fiddle (the parentId
property in setter mode should do the described check): http://jsbin.com/UDoPajA/201/edit?html,js,output
Upvotes: 0
Views: 38
Reputation: 47367
Generally a 404 response is used when a record isn't found. In this particular instance you're using an extremely old version of Ember and Ember Data. So in a general use case you would do it like so:
this.store.find('color', 1).then(function(record){
console.log('record', record);
}, function(error){
console.log('error', error);
});
http://emberjs.jsbin.com/OxIDiVU/572/edit
Upvotes: 1