i upgraded ember 1.11.1 1.13.2, , ember-data 1.13.4
since then, i'm not able set property on resolved promise:
var promise = store.filter('user', {filters: {"googleid":content.id}}, function() { return promise; }).then(function(response) { var user = response.get('content.0'); console.log(user); //--> user entity (object { type: makector/class(), id: "38", store: object, [...]) user.set('foo', "bar"); // crash here }, function(){ [...] }); the error message console no help, since i'm in .then()
edit : context : i'm inside initializer called session.js. i'm trying realise google authentication. specific piece of code after retrieving google infos api. i'm trying see if user such google id exists in back-end, , if it's case (promise resolved), want update user up-to-date google informations , save them back-end (hence .set())
using debugger, figured other way access data works:
var promise = store.filter('user', {filters: {"googleid":content.id}}, function() { return promise; }).then(function(response) { var user = arguments[0]; console.log(user); //--> user entity user.set('foo', "bar"); // ok }, function(){ [...] }); i surprised, arguments seems come nowhere. there maybe cleaner way it.
Comments
Post a Comment