This repository has been archived on 2025-03-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hymenobacterdotinfo/app/pods/species/new/controller.js
2015-06-05 08:35:44 -08:00

21 lines
484 B
JavaScript

import Ember from 'ember';
export default Ember.Controller.extend({
isEditing: true,
actions: {
save: function() {
var species = this.get('model');
if (species.get('isDirty')) {
species.save();
}
this.transitionToRoute('species.index');
},
cancel: function() {
var species = this.get('model');
if (species.get('isNew')) {
species.deleteRecord();
}
this.transitionToRoute('species.index');
}
}
});