Created
November 27, 2019 17:40
-
-
Save gordonbisnor/80ce32d2bf85a570340b32bd4f78ecae to your computer and use it in GitHub Desktop.
This file contains 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 Mixin from '@ember/object/mixin'; | |
export default Mixin.create({ | |
isShowingDeleteConfirmation: false, | |
actions: { | |
requestDelete() { | |
this.toggleProperty('isShowingDeleteConfirmation'); | |
}, | |
cancelDelete() { | |
this.toggleProperty('isShowingDeleteConfirmation'); | |
}, | |
delete(item) { | |
this.toggleProperty('isShowingDeleteConfirmation'); | |
item.destroyRecord().then( () => { | |
let p = this.get('parentRoute'); | |
this.transitionToRoute(p); | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment