I'd like to persist a record when the user exits my app. I have the following code in my controller:
addUnloadEvent: function () {
let _this = this;
Ember.$(window).unload(function() {
console.log("ATTEMPTING TO PERSIST RECORD");
let record = _this.get('model');
console.log("RECORD: "+record);
record.save();
});
}.on('init'),
The console logs the record when I close the app, but no server request is made. Any help is appreciated.
Aucun commentaire:
Enregistrer un commentaire