Pods, pods, everywhere
This commit is contained in:
parent
33f783bc42
commit
e623d52f34
66 changed files with 53 additions and 113 deletions
22
app/pods/species/show/controller.js
Normal file
22
app/pods/species/show/controller.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
isEditing: false,
|
||||
actions: {
|
||||
save: function() {
|
||||
var species = this.get('model');
|
||||
if (species.get('isDirty')) {
|
||||
species.save();
|
||||
}
|
||||
this.toggleProperty('isEditing');
|
||||
},
|
||||
cancel: function() {
|
||||
if (this.get('isEditing')) {
|
||||
var species = this.get('model');
|
||||
species.get('errors').clear();
|
||||
species.rollback();
|
||||
}
|
||||
this.toggleProperty('isEditing');
|
||||
}
|
||||
}
|
||||
});
|
4
app/pods/species/show/route.js
Normal file
4
app/pods/species/show/route.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
7
app/pods/species/show/template.hbs
Normal file
7
app/pods/species/show/template.hbs
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{
|
||||
species-details
|
||||
species=model
|
||||
isEditing=isEditing
|
||||
save="save"
|
||||
cancel="cancel"
|
||||
}}
|
Reference in a new issue