- Ember 1.9.0 and ember-data 1.0.0-beta.12
- Bootstrap-sass 3.0.2
- jquery 1.11.1
All these packages can be installed via Bower. The code has been tested with ember-cli 0.1.4.
The flash message can be set from the controller by adding a needs
dependency for the flashMessage
controller. See the example below.
`import FlashDispatchable from '../mixins/flash-dispatchable'`
PostController = Ember.ObjectController.extend FlashDispatchable,
actions:
save:
# do something
@flashMessage('unable to save object', 'error').now()
`export default PostController`
Then you can render the flash message putting the following code in the desired template
This gist is inspired by the ember-flash-message plugin of ryanto.