Skip to content

Instantly share code, notes, and snippets.

@selvagsz
Created March 14, 2018 11:26
Show Gist options
  • Save selvagsz/0346eb80758fbacfc41b9fd41a9f78c0 to your computer and use it in GitHub Desktop.
Save selvagsz/0346eb80758fbacfc41b9fd41a9f78c0 to your computer and use it in GitHub Desktop.
export default Ember.Component.extend({
modalPane: injectService(),
// 1.
delete() {
this.get('modalPane').confirm({
header: 'Delete Tab',
message: 'Are you sure to delete the tab?'
affirm: () => {
// handle confirm
},
decline: () => {
// handle cancel
},
});
},
// 2.
delete() {
this.get('modalPane').confirm({
header: 'Delete Tab',
message: 'Are you sure to delete the tab?'
}).then(() => {
// handle confirm
}).catch(() => {
// handle cancel
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment