censis-obrand/dev-archive/censis/obrand/obrand-admin/app/controllers/profile.js
2016-03-29 12:15:56 +01:00

32 lines
745 B
JavaScript

'use strict';
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() {
var model = this.get('model');
this.set('sessionAccount.account.forename', model.get('forename'));
// this.profile.save();
console.log(model.get('dob'));
this.model.save()
.then(function(d) {
console.log(d);
})
.catch(function(err) {
console.log(err);
});
this.set('isEditing', false);
}
}
});