Saturday, 28 September 2013

Cannot call method 'lookup' of undefined when saving model in emberjs

Cannot call method 'lookup' of undefined when saving model in emberjs

im using LSA as my application adapter. im trying to update a model but i
get an error that say
Uncaught TypeError: Cannot call method 'lookup' of undefined
ember-data.js:231
i have a controller and in actions of controller i write these codes :
al:function(id){
console.log(this.store.find('axisModel'));
this.store.find('axisModel',id).then(function(item){
item.set('orderId','1000');
item.save();
//console.log(item);
});
},
i have access to store and store can find a record and when i set orderId
it set on ui but when i try item.save() for saving in localstorage i get
an error.my ember-data verison is v1.0.0-beta.1-39-g80dcf42 and ember
version is v1.0.0 . if i comment item.save() the ui was update but the
model in local storage dosent update and if i uncomment this i get an
error .

No comments:

Post a Comment