project/app/controllers/company.js

30 lines
651 B
JavaScript
Raw Normal View History

2016-04-06 15:53:06 +00:00
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() {
2016-04-07 15:45:00 +00:00
'use strict';
2016-04-06 15:53:06 +00:00
this.set('isEditing', false);
var model = this.get('model');
model.save()
.catch(function(err) {
console.error(err);
});
}, cancelEdit: function() {
2016-04-07 15:45:00 +00:00
'use strict';
2016-04-06 15:53:06 +00:00
var model = this.get('model');
model.rollbackAttributes();
this.set('isEditing', false);
}
}
});