Happily continuing my journey to learn Ember.js, I am creating a relationship between two objects like this:
var item = App.Item.find( itemId );
item.set('stage', stage);
item.store.commit()
This produces an error.
Ok, so I added the following to my model:
App.Item = DS.Model.extend({
stage: DS.belongsTo( 'App.Stage' ),
title: DS.attr('string'),
desc: DS.attr('string'),
becameError: function(error) {
console.log("* item becameError");
console.log(this.get('errors')); // <- this
}
});
This prints out the "* item becameError" in the JS-console, but the second console.log evaluates to "null".
How do I get more information about what caused the error? ( My REST-API logs show things went just well, the record is stored correctly and when I refresh the browser Ember displays the data as it should be. )