ember-growl-notification
Ember-cli addon to create growl like components.
Simple Usage
Just put {{ember-growl-notification-placeholder}}
to your application.hbs
.
And call ember-growl-service
s showNotification(notification)
method.
Sample Demo from Twiddle
showNotification parameters:
- message: string to be displayed
- type: should be either
success
,error
orinfo
to apply corresponding styles. - timeout: display timeout in seconds.
Changing the view of items
With the contextual usage of {{ember-growl-notification-placeholder}}
, you can easily modify the view of the items.
{{#ember-growl-notification-placeholder as |notification close|}} <div> This is it! <br> {{notification.message}} <br> <button onclick={{action close}}>Close</button> </div>{{/ember-growl-notification-placeholder}}
In-Place Usage
If you want to create a very customized message in a template. You can use {{ember-growl-notification}}
component.
{{#if isShown}} {{#ember-growl-notification}} My funny message! {{/ember-growl-notification}} {{/if}}
Defining New Types
Predefined types are: success
, info
and error
. Add relevant styles as following:
/* new type: 'warning' */
Roadmap to 1.0.0
- Prepare the readme file
- Add meaningful tests
- Setup the CI environment
-
Create a demo app