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

24 lines
619 B
JavaScript

import Ember from 'ember';
const { service } = Ember.inject;
export default Ember.Controller.extend({
session: service('session'),
sessionAccount: service('session-account'),
genders: [{g: 'Male', id: 0}, {g: 'Female', id: 1}],
actions: {
editProfile: function() {
this.set('isEditing', true);
}, saveProfile: function() {
'use strict';
var model = this.get('model');
this.set('sessionAccount.account.forename', model.get('forename'));
this.model.save()
.catch(function(err) {
console.error(err);
});
this.set('isEditing', false);
}
}
});