pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
import Ember from 'ember';
export default Ember.Route.extend({
options: Ember.inject.service(),
model(params) {
return this.store.findRecord('document', params.doc_id);
},
actions: {
saveDocument: function(doc) {
doc.save();
if(this.get('options').backurl) {
window.location.replace(this.get('options').backurl);
}
else {
this.transitionTo('index');
}
},
cancelDocument: function(doc) {
doc.rollbackAttributes();
doc.reload();
}
}
});