project/app/controllers/company.js
2016-04-07 16:45:00 +01:00

30 lines
651 B
JavaScript

import Ember from 'ember';
const {service} = Ember.inject;
export default Ember.Controller.extend({
session: service('session'),
sessionAccount: service('session-account'),
actions: {
editCompany: function() {
this.set('isEditing', true);
}, saveCompany: function() {
'use strict';
this.set('isEditing', false);
var model = this.get('model');
model.save()
.catch(function(err) {
console.error(err);
});
}, cancelEdit: function() {
'use strict';
var model = this.get('model');
model.rollbackAttributes();
this.set('isEditing', false);
}
}
});