Last active
August 29, 2015 14:16
-
-
Save lessless/91911aad91857ea949c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
actions: { | |
saveModel: function() { | |
Ember.RSVP.all([ | |
this.currentModel.save(), | |
this.currentModel.get('notifications').save() | |
]).then( () => { | |
this.showFlashNow('Saved Successfully!', 'success'); | |
}).catch( () => { | |
this.showFlashNow('Saved Successfully!', 'alert'); | |
}); | |
} | |
}, | |
deactivate: function() { | |
this.currentModel.rollback(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment