Amber: 1.0.0-rc.6
Ember-Data: e999edb (2013-07-06 06:03:59 -0700)
I am making a REST (POST) call to login the user. Server response approved. I need an identifier from the server, but I only got the ID with "setTimeout".
I think this is the wrong way.
What's my mistake?
Inside the controller, I call:
var login = App.Login.createRecord(this.getProperties("email", "password"));
login.on("didCreate", function(record) {
console.log(record.get("id"));
console.log(record.get("email"));
});
setTimeout(function() {
console.log(login.get("id"));
console.log(login.get("email"));
}, 500);
DS.defaultStore.commit();
source
share