Skip to content

Instantly share code, notes, and snippets.

@poteto
Created February 1, 2015 12:46
Show Gist options
  • Save poteto/5db523d436c6aaa3d02e to your computer and use it in GitHub Desktop.
Save poteto/5db523d436c6aaa3d02e to your computer and use it in GitHub Desktop.
actions: {
successAction() {
Ember.get(this, 'flashes').success('Success!', 2000);
},
warningAction() {
Ember.get(this, 'flashes').warning('This is a warning message'); // timeout is optional
},
infoAction() {
Ember.get(this, 'flashes').info('You just did something...', 500);
},
dangerAction() {
Ember.get(this, 'flashes').danger('So danger');
},
customAction() {
Ember.get(this, 'flashes').addMessage('This is a flash with a custom type', 'myCustomType', 3000)
},
clearMessages() {
Ember.get(this, 'flashes').clear(); // clears all visible flash messages
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment